Skip to content

Conversation

@severinbratus
Copy link
Contributor

@severinbratus severinbratus commented Jun 16, 2024

Deploying a private repo requires a secret named GH_PAT with a PAT token with at least the scopes repo, read:org, gist (these scopes are listed here: https://cli.github.com/manual/gh_auth_login).

See also comment:

env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  # Relevant and required for Private repositories only!
  # 1. First, create a Personal Access Token (Classic) as in https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
  #    with at least the scopes `repo`, `read:org`, and `gist`.
  # 2. Then, make a secret GH_PAT in `Settings` > `Secrets and variables` > `Actions` > `Repository secrets` or `Organization secrets`.
  #    Copy & paste the PAT from step 1.
  #
  # Clarifications on naming:
  # GH_TOKEN is the name that the `gh` CLI utility expects.
  # GITHUB_TOKEN is a special automatically assigned token described here https://docs.github.com/en/actions/security-guides/automatic-token-authentication
  GH_TOKEN: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || secrets.GITHUB_TOKEN }}
  

Tested at:

Resolves #32

Copy link
Member

@Tom-van-Woudenberg Tom-van-Woudenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful!

@Tom-van-Woudenberg Tom-van-Woudenberg merged commit 4068b0f into main Jun 17, 2024
@Tom-van-Woudenberg Tom-van-Woudenberg deleted the fix/allow-private-repos branch June 17, 2024 06:15
Tom-van-Woudenberg added a commit to TeachBooks/template that referenced this pull request Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow for private repos

3 participants