Skip to content

ci(automerge): AUTOMERGE_PAT with GITHUB_TOKEN fallback#74

Merged
amavashev merged 1 commit into
mainfrom
chore/automerge-pat-fallback
Jun 7, 2026
Merged

ci(automerge): AUTOMERGE_PAT with GITHUB_TOKEN fallback#74
amavashev merged 1 commit into
mainfrom
chore/automerge-pat-fallback

Conversation

@amavashev
Copy link
Copy Markdown
Contributor

Wire the Dependabot auto-merge workflow to use an optional AUTOMERGE_PAT
secret, falling back to GITHUB_TOKEN:

GH_TOKEN: ${{ secrets.AUTOMERGE_PAT || secrets.GITHUB_TOKEN }}

The default GITHUB_TOKEN is forbidden by GitHub from enabling auto-merge on
PRs that modify .github/workflows/**, so github/codeql-action / actions/*
Dependabot bumps stall and need a manual/admin merge. A PAT (or App token) with
repo + workflow scope stored as AUTOMERGE_PAT lets those auto-merge. The
|| fallback keeps current behavior until the secret exists, so this is safe
on its own.

The default GITHUB_TOKEN cannot enable auto-merge on PRs that modify
.github/workflows/** (github-actions ecosystem bumps), so those Dependabot
PRs stall and need a manual/admin merge.

Allow an optional AUTOMERGE_PAT secret (repo + workflow scope) to be used
for `gh pr merge --auto`, falling back to GITHUB_TOKEN when the secret is
not set — so behavior is unchanged until the secret is added.
@amavashev amavashev merged commit c845847 into main Jun 7, 2026
3 checks passed
@amavashev amavashev deleted the chore/automerge-pat-fallback branch June 7, 2026 17:26
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