devmasx / merge-branch

A GitHub Action that merge PR branch to other branchs
161 stars 58 forks source link

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

Open shadoath opened 3 years ago

shadoath commented 3 years ago

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 commented 3 years ago

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

CWSites commented 2 years ago

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