Skip to content

Auto-merge Dependabot PRs once "Test PyShEx" is green - #123

Open
ericprud wants to merge 1 commit into
masterfrom
dependabot-auto-merge
Open

ericprud wants to merge 1 commit into
masterfrom
dependabot-auto-merge

Conversation

@ericprud

Copy link
Copy Markdown
Collaborator

Dependabot PRs here currently wait for someone to click merge even when every check is green; #120, #121 and #122 are in that state now. This adds a workflow that merges them once CI passes.

How it works

  • It runs on workflow_run after "Test PyShEx" completes. That job runs from master, not the PR branch, so no dependency code from the PR executes with a write token.
  • It merges only if:
    • the PR's author is Dependabot, and
    • every check run on the PR's head commit is finished and green: all matrix legs, policy, downstream, and the reruns caused by labeled events.
  • It uses --match-head-commit, so a commit that CI didn't test is never merged.
  • It uses merge commits, matching this repo's history.
  • It needs no branch protection, no ruleset and no "Allow auto-merge" setting; it only uses GITHUB_TOKEN with contents/pull-requests: write.
  • Merges are serialized: after each one, Dependabot rebases the next PR and CI re-runs.

Majors
All semver levels merge on green, since the test matrix plus the API-compat and downstream jobs are the gate. To hold majors for review, there's a commented-out guard in the workflow to uncomment.

Note
If the org caps Actions' workflow permissions at read-only, the merge step will fail with a 403 and nothing gets merged. The workflow can't change that setting itself.

The same workflow has been merging Dependabot PRs in shexjs/shex.js since October 2026, and on ericprud/jsg and ericprud/shex-to-jsonld-context since this week.

Once this is on master, comment @dependabot rebase on #120–122 to have them go through it. #120 and #122 are the same gh-action-pypi-publish bump twice; one can be closed.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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