merge-branch icon indicating copy to clipboard operation
merge-branch copied to clipboard

Can a Personal Access Token be used in place of github.token?

Open shadoath opened this issue 3 years ago • 2 comments

Found out that workflows by GitHub actions using a GitHub token don't trigger other workflows (due to concern of infinite loop).

Is it as simple as swapping to my PAT to avoid this issue?

shadoath avatar Apr 27 '21 22:04 shadoath

When you use the repository's GITHUB_TOKEN to perform tasks on behalf of the GitHub Actions app, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs. For example, if a workflow run pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur.

Link

shadoath avatar Apr 27 '21 22:04 shadoath

If I remember correctly it also has to do with permissions, your regular github.token has read only permissions, you need to setup a REPO_ACCESS_TOKEN which has write permissions for an action like this.

https://docs.github.com/en/actions/security-guides/automatic-token-authentication

CWSites avatar Dec 10 '21 15:12 CWSites