Repository navigation
Conversation
The Dependabot Auto-merge workflow used ridedott/merge-me-action with the AWBOT_GH_TOKEN secret. That PAT is expired, so every triggered run fails with "Bad credentials" and Dependabot PRs no longer auto-merge. Merge directly in the trusted workflow_run context with the repository token instead. Also require workflow_run.event == 'pull_request' so master push builds are skipped. Same change as ActivityWatch/aw-webui#901 and ActivityWatch/aw-server-rust#643. Git-Session-Id: 542379d1-1c80-59bc-8b62-6115fac2183f
[Medium impact] The change affects automated dependency merges in this repository. The PR appears safe to merge, with a non-blocking loss of checks and reports after Dependabot merges. Findings
SummaryReplaces the expired PAT-based merge action with
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Build completes] --> B{Successful Dependabot PR run?}
B -->|No| C[Skip]
B -->|Yes| D[Fetch associated PR]
D --> E{Open and not draft?}
E -->|No| C
E -->|Yes| F[Squash merge exact built SHA]
F --> G[Repository token suppresses push workflows]
Reviews (1) · Last reviewed commit: "fix(ci): drop brittle PAT-based dependab..." · Reviewed by Greptile |
| await github.rest.pulls.merge({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: pull.number, | ||
| merge_method: "squash", | ||
| sha: context.payload.workflow_run.head_sha, | ||
| }); |
There was a problem hiding this comment.
Using GITHUB_TOKEN for pulls.merge stops the resulting push from triggering GitHub Actions. Dependabot merges will skip the master runs of Build, Lint, and CodeQL, including the coverage upload and default-branch CodeQL results. The PR runs still happen, but they do not update those results for the merged commit.
Explicitly trigger the needed follow-up workflows after merging, or use a GitHub App token to keep those push runs automatic.
There was a problem hiding this comment.
Fixed in 671d3c9. A confirmed successful merge now explicitly dispatches Build, Lint and CodeQL on the base branch; all three workflows accept workflow_dispatch, and the merge job has actions: write. Missing, closed or draft PRs and failed/rejected merges dispatch nothing. Dispatch-triggered Build runs cannot recurse into automerge because its job requires a pull_request-origin run.
Verified YAML triggers and permissions, plus six local behavioral cases against the actual extracted github-script. actionlint passes after filtering only its pre-existing old-action-runtime warnings; those action upgrades are outside this fix. New-head CI is running. Live post-merge dispatch remains to be verified after this workflow lands on master.
Git-Session-Id: 7398bd5f-c85f-5672-bdad-b145f953d55f
Problem
Dependabot Auto-mergeis failing on master for every triggered run:The workflow calls
ridedott/merge-me-action@v2withsecrets.AWBOT_GH_TOKEN, aPersonal Access Token from the
@ActivityWatchBotuser. That PAT has expired or beenrevoked, so the action cannot authenticate. Effect: Dependabot PRs stop auto-merging
and pile up.
Runs: 39324736647, 39324784943, 39324947069, 39325074693, 39325076771, 39325120187.
Fix
Merge Dependabot PRs directly in the trusted
workflow_runcontext with therepository token instead of an external PAT:
actions/github-script(pinned to thev9SHA) callspulls.mergewithmerge_method: squashand the exactworkflow_run.head_sha.permissions.pull-requestsgoes fromreadtowrite.github.event.workflow_run.event == 'pull_request', somaster push builds no longer trigger a pointless auto-merge attempt.
This is the same change already shipped for the same expired-PAT failure in
ActivityWatch/aw-webui#901 and ActivityWatch/aw-server-rust#643, so the three repos
stop depending on a token that needs manual rotation.
Verification
on,permissions, and the jobifall read back as intended.Buildrun on a Dependabot PR → squash merge).AWBOT_GH_TOKENcan beretired.
Note: this only takes effect once merged to
master, sinceworkflow_runworkflowsalways execute from the default branch.