Is a personal access token needed? #26998
-
I have the following Action set up in order to push files to the GitHub Pages branch using MkDocs. The question I now have is, if the GH_TOKEN, which is a Personal Access Token, is required for this to work, or if I can replace it with something else (or remove it altogether). The YAML file I have setup
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @andre601 , If you’re pushing commit to ‘gh-pages’ branch in same repository, you can skip token:
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:
Thanks. |
Beta Was this translation helpful? Give feedback.
-
Thanks. It works without any issues. |
Beta Was this translation helpful? Give feedback.
Hi @andre601 ,
If you’re pushing commit to ‘gh-pages’ branch in same repository, you can skip token:
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:
Thanks.