Skip to content

[ci] Auto-merge workerd Dependabot updates when CI is green#13852

Open
penalosa wants to merge 2 commits intomainfrom
penalosa/auto-merge-workerd
Open

[ci] Auto-merge workerd Dependabot updates when CI is green#13852
penalosa wants to merge 2 commits intomainfrom
penalosa/auto-merge-workerd

Conversation

@penalosa
Copy link
Copy Markdown
Contributor

@penalosa penalosa commented May 7, 2026

workerd ships a release every weekday, producing a steady stream of mechanical Dependabot PRs in the workerd-and-workers-types group (e.g. #13841). When CI is green these PRs require no human review, so this enables GitHub auto-merge for them. Required status checks remain the gate — a failing build still parks the PR for a human.

Implementation notes:

  • Triggers on pull_request_target to match the existing miniflare-dependabot-versioning-prs.yml and c3-dependabot-versioning-prs.yml workflows.
  • Gated by both github.event.pull_request.user.login == 'dependabot[bot]' and dependency-group == 'workerd-and-workers-types', so it never auto-merges anything else.
  • No actions/checkout step — PR-controlled code never touches the elevated token.
  • dependabot/fetch-metadata is SHA-pinned (passes pnpm check:workflows).

Prerequisites for this to take effect (require a repo admin):

  1. Repo settings → "Allow auto-merge" must be enabled.
  2. Branch protection on main should already require the relevant status checks; this PR does not change them.

The existing miniflare-dependabot-versioning-prs.yml already auto-generates the changeset on these PRs, so once auto-merge is enabled the loop should be fully closed.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: this is a CI-only workflow that can only be exercised by a real Dependabot PR against main. Behavior is gated by two conditions (actor and dependency-group) and any failure mode degrades to "auto-merge not enabled" — no destructive path.
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal CI automation, no user-facing surface.

workerd ships a release every weekday, producing a steady stream of
mechanical Dependabot PRs in the workerd-and-workers-types group. These
PRs require no human review when CI passes, so enable GitHub auto-merge
for them. Required status checks remain the gate — a failing build still
parks the PR for a human.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: 6f75524

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 7, 2026

SHA pin matches. Let me review the workflow one more time carefully:

  1. Trigger: pull_request_target with appropriate event types — consistent with existing workflows.
  2. Permissions: contents: write and pull-requests: write — minimal and correct for enabling auto-merge.
  3. Job condition: Gated on dependabot[bot] actor.
  4. Step 1: dependabot/fetch-metadata SHA-pinned correctly to v2.3.0.
  5. Step 2: Second gate on dependency-group == 'workerd-and-workers-types', uses gh pr merge --auto --squash.
  6. No checkout: Correctly avoids checking out PR code, so no code execution with elevated token.
  7. Token usage: Uses secrets.GITHUB_TOKEN (not a PAT), appropriate for this use case.

The workflow is clean, follows existing patterns in the repo, and the security model is sound (double-gated, no checkout, SHA-pinned action).

LGTM

github run

@penalosa penalosa added the no-changeset-required Skip PR check for valid changeset label May 7, 2026
@penalosa penalosa marked this pull request as ready for review May 7, 2026 15:05
@penalosa penalosa requested a review from workers-devprod as a code owner May 7, 2026 15:05
@workers-devprod workers-devprod requested review from a team and dario-piotrowicz and removed request for a team May 7, 2026 15:06
@workers-devprod
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .github/workflows/dependabot-auto-merge.yml: [@cloudflare/wrangler]

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Add a verification step that ensures the PR contains exactly the two
expected commits (signed Dependabot commit + changeset commit from
miniflare-dependabot-versioning-prs.yml) and only touches the expected
fileset. If a maintainer pushes a follow-up commit, verification fails
and any previously-enabled auto-merge is cancelled.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 7, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13852

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13852

miniflare

npm i https://pkg.pr.new/miniflare@13852

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13852

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13852

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13852

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13852

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13852

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@13852

wrangler

npm i https://pkg.pr.new/wrangler@13852

commit: 6f75524

# may not have run yet, in which case we bail and wait for the
# `synchronize` event from its push.
if ! echo "$files_json" | jq -e '.files[] | select(.path | startswith(".changeset/dependabot-update-"))' > /dev/null; then
fail "changeset file not yet present; waiting for changeset job to push it"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will these fail statements actually cause the job to fail?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which case the "disable auto-merge" step may not run?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changeset-required Skip PR check for valid changeset

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants