Skip to content

Commit

Permalink
Add GITHUB_REPOSITORY env to GitHub Action tip
Browse files Browse the repository at this point in the history
The hard-coded repository name can be replaced with the use
of the GITHUB_REPOSITORY environmental variable available
to the runner by default. The GitHub Actions tip has been
updated to reflect this feature.
  • Loading branch information
mickelsonmichael committed Feb 28, 2021
1 parent 41efe38 commit 057903e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,15 +393,14 @@ If `gh-pages` fails, you may find that you need to manually clean up the cache d
In order to deploy with Github Actions, you will need to define a user and set the git repository for the process. See the example step below

```
# REPLACE "tschaub/gh-pages" IN THE GIT URL BELOW WITH YOUR REPOSITORY'S INFORMATION
- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/tschaub/gh-pages.git
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -d build -u "github-actions-bot <support+actions@github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

The `secrets.GITHUB_TOKEN` is provided automatically as part of the Github Action and does not require any further configuration, but simply needs to be passed in as an environmental variable to the step.
The `secrets.GITHUB_TOKEN` is provided automatically as part of the Github Action and does not require any further configuration, but simply needs to be passed in as an environmental variable to the step. `GITHUB_REPOSITORY` is the owner and repository name and is also passed in automatically, but does not need to be added to the `env` list.

See [Issue #345](https://github.com/tschaub/gh-pages/issues/345) for more information

0 comments on commit 057903e

Please sign in to comment.