ci: allow backport workflow to use a PAT to trigger downstream CI#853
Conversation
…icGamesExt#655) PRs opened with the default GITHUB_TOKEN do not trigger downstream pull_request workflows (an anti-recursion safeguard), which is why backport PRs land without CI running on them. Read the github_token from BACKPORT_PAT first and fall back to GITHUB_TOKEN, so configuring a repo/org secret named BACKPORT_PAT (PAT with repo scope) unlocks CI on backport PRs without any further code change. Behavior is unchanged when the secret is not configured.
|
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
…) (#853) (#855) PRs opened with the default GITHUB_TOKEN do not trigger downstream pull_request workflows (an anti-recursion safeguard), which is why backport PRs land without CI running on them. Read the github_token from BACKPORT_PAT first and fall back to GITHUB_TOKEN, so configuring a repo/org secret named BACKPORT_PAT (PAT with repo scope) unlocks CI on backport PRs without any further code change. Behavior is unchanged when the secret is not configured. (cherry picked from commit 9d9db1d)
…) (#853) (#856) PRs opened with the default GITHUB_TOKEN do not trigger downstream pull_request workflows (an anti-recursion safeguard), which is why backport PRs land without CI running on them. Read the github_token from BACKPORT_PAT first and fall back to GITHUB_TOKEN, so configuring a repo/org secret named BACKPORT_PAT (PAT with repo scope) unlocks CI on backport PRs without any further code change. Behavior is unchanged when the secret is not configured. (cherry picked from commit 9d9db1d)
…) (#853) (#857) PRs opened with the default GITHUB_TOKEN do not trigger downstream pull_request workflows (an anti-recursion safeguard), which is why backport PRs land without CI running on them. Read the github_token from BACKPORT_PAT first and fall back to GITHUB_TOKEN, so configuring a repo/org secret named BACKPORT_PAT (PAT with repo scope) unlocks CI on backport PRs without any further code change. Behavior is unchanged when the secret is not configured. (cherry picked from commit 9d9db1d)
Summary
github_tokenfromsecrets.BACKPORT_PAT || secrets.GITHUB_TOKENin.github/workflows/backport.yml.BACKPORT_PATis not set.BACKPORT_PATis configured (a PAT withreposcope), backport PRs will trigger downstreampull_requestworkflows like the rest of CI.GitHub deliberately doesn't fire
pull_requestevents for PRs opened with the defaultGITHUB_TOKEN(anti-recursion safeguard), which is why backport PRs land without CI running on them.Test plan
BACKPORT_PATsecret (PAT withreposcope).GITHUB_TOKEN, so behaviour is unchanged for forks / contributors who haven't configured the secret.Closes #655.