Skip to content

Is a personal access token needed? #26998

Answered by weide-zhou
Andre601 asked this question in Actions
Discussion options

You must be logged in to vote

Hi @andre601 ,

If you’re pushing commit to ‘gh-pages’ branch in same repository, you can skip token:

git remote add gh-token "https://github.com/Andre601/MyRepo.git"

This is due to ‘actions/checkout’ will automatically add GITHUB_TOKEN to later git operations, and the token has write permission to current repo.

If you push commit to another repository, personal access token is needed. Code sample as below:

git remote add gh-token "https://weide-zhou:${{ secrets.PAT1 }}@github.com/weide-zhou/ticket14.git"

Thanks.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants