Skip to content

ci(MAPCO-11679): fall back to github.token when GH_PAT is unset - #12

Open
razbroc wants to merge 2 commits into
masterfrom
ci/workflow-tokens
Open

razbroc wants to merge 2 commits into
masterfrom
ci/workflow-tokens

Conversation

@razbroc

@razbroc razbroc commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

auto-author-assign and release-please passed secrets.GH_PAT with no fallback, so if that secret is ever missing the jobs fail with Input required and not supplied.

Both now use ${{ secrets.GH_PAT || github.token }}. GH_PAT still wins when it is set; github.token is always populated and both jobs already hold the permissions those actions need.

One caveat, noted in the workflow file: on the github.token fallback path, the release PR that release-please opens will not run the pull_request checks, because events created by GITHUB_TOKEN do not trigger workflows. The release itself is unaffected.

Ref MAPCO-11679.

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.
@razbroc razbroc changed the title ci: give the workflow tokens a value that exists ci(MAPCO-11679): fall back to github.token when GH_PAT is unset Sep 15, 2026
@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown

🎫 Related Jira Issue: MAPCO-11679

GH_PAT turned out to be configured after all (the org secret is granted to
this repo), so the long write-up about it being missing was wrong. Keep just
the one line that says why the fallback is there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant