ci: give the workflow tokens a value that exists - #12
Open
razbroc wants to merge 1 commit into
Open
Conversation
Both failing workflows failed for the same reason: `secrets.GH_PAT` is not configured on this repo, so the input resolved to an empty string and the action refused to start. PR Author Auto Assign Input required and not supplied: repo-token release-please release-please failed: Input required and not supplied: token Both now prefer `GH_PAT` and fall back to `github.token`, which is always populated. Each job already holds the permissions its action needs, so nothing depends on a secret being set. If the org sets `GH_PAT` later it takes precedence with no further change. This has to land on master to take effect. 908f19a and a88de87 both changed auto-author-assign.yml on a feature branch and neither ran: pull requests whose base branch already carried a working token still failed with the empty-input error, so `pull_request_target` is not resolving the workflow from the base. The copy on the default branch is the one that executes. For release-please the built-in token has a known cost: events created with GITHUB_TOKEN do not trigger workflows, so the release PR will not run the pull_request checks. Noted in the file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two workflows have been failing on every run. Same cause, one line each.
secrets.GH_PATis not configured on this repo (gh secret listis empty), so both inputs resolved to an empty string and each action refused to start. Both now preferGH_PATand fall back togithub.token, which is always populated. Each job already grants the permissions its action needs —pull-requests: writefor the assigner,contents: write+pull-requests: writefor release-please — so neither depends on a secret existing. If the org setsGH_PATlater it takes precedence with no further change.908f19a and a88de87 both fixed
auto-author-assign.yml, and neither changed anything, because both landed on a feature branch.The evidence is on the four PRs opened this morning.
repo-tokenper ref at the time they ran:master${{ secrets.GH_PAT }}feat/ticket-polling-worker${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}feat/claim-and-release${{ github.token }}feat/implement-and-verify${{ github.token }}Run
33045474256is PR #7, whose base isfeat/claim-and-release— a ref that already carriedgithub.token. It still failed with the empty-input error. PR #8, based onfeat/implement-and-verify, also carriedgithub.tokenand also failed.So
pull_request_targetis not resolving this workflow from the base branch; the copy on the default branch is the one that executes. That also means a88de87's conclusion — that thesecrets.GH_PAT || secrets.GITHUB_TOKENfallback "still resolved to an empty input" — was measuring a file that never ran.secrets.GITHUB_TOKENwas most likely fine all along.Consequence for review: this is the only place a fix to that workflow is visible, and it has to merge to
masterdirectly rather than riding the MAPCO-11429 → 11431 → 11434… stack.Expect a conflict when the stack merges
feat/ticket-polling-worker(#5) andfeat/claim-and-release(#6) both carry their own edits toauto-author-assign.yml. Merging either into a master that has this change will conflict on that one line. Take this version —${{ secrets.GH_PAT || github.token }}— and drop the branch's.The release-please trade-off is real
Events created with
GITHUB_TOKENdo not trigger workflows, so the release PR release-please opens will not run thepull_requestchecks. That is the reason a PAT is the usual advice for this action, and it is why the original file carried that comment. The release itself is unaffected.The alternative is leaving every push to
masterred until someone provisionsGH_PAT. A release PR with no CI on it seems the better failure, and it is documented in the file so whoever sets the secret knows what they are fixing. Say the word if you'd rather this workflow stayed failing until the PAT exists — happy to drop that half.Refs: MAPCO-11429