Skip to content

Commit

Permalink
Use token in checkout action
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Nov 26, 2022
1 parent ca648bb commit 338c0a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Git config
env:
GH_USER: ${{ secrets.GH_USER }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
run: |
git remote set-url --push origin "https://${GH_USER}:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git config user.name "$GIT_USER_NAME"
git config user.email "$GIT_USER_EMAIL"
token: ${{ secrets.GH_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
Expand Down
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,14 @@ _GitHub Actions should already be configured: this section is for reference only

The following repository secrets must be set on [GitHub Actions]:

- `GH_USER`: The GitHub user's username to pull and push containers.
- `GH_TOKEN`: A personal access token that can trigger workflows.
- `GIT_USER_NAME`: The GitHub user's real name.
- `GIT_USER_EMAIL`: The GitHub user's email.
- `GPG_PRIVATE_KEY`: The GitHub user's [GPG private key].
- `GPG_PASSPHRASE`: The GitHub user's GPG passphrase.

These must be set manually.

### Secrets for Optional GitHub Actions

The version and format GitHub actions
require a user with write access to the repository,
including access to trigger workflows.
Set these additional secrets to enable the action:

- `GH_USER`: The GitHub user's username.
- `GH_TOKEN`: A personal access token for the user.
- `GIT_USER_NAME`: The GitHub user's real name.
- `GIT_USER_EMAIL`: The GitHub user's email.

[GitHub Actions]: https://github.com/features/actions
[GPG private key]: https://github.com/marketplace/actions/import-gpg#prerequisites

Expand Down

0 comments on commit 338c0a2

Please sign in to comment.