Skip to content

Stop approving Dependabot PRs with GITHUB_TOKEN - #667

Merged
jeremy merged 1 commit into
mainfrom
actions-drop-dependabot-approval
Nov 21, 2026
Merged

jeremy merged 1 commit into
mainfrom
actions-drop-dependabot-approval

Conversation

@jeremy

@jeremy jeremy commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The basecamp org is about to turn off "Allow GitHub Actions to create and approve pull requests" (Security Hardening, step 4). After that, gh pr review --approve with GITHUB_TOKEN fails.

This PR deletes the step in dependabot-auto-merge.yml that approves Dependabot's patch and minor bumps with GITHUB_TOKEN. The step that turns on auto-merge stays as it was.

Why the approval can go:

  • main requires no approving review. Read today from GET /repos/basecamp/hey-cli/rules/branches/main: every pull_request rule has required_approving_review_count: 0, and the branch has no classic protection. require_extra_approval_for_unattributed_changes applies only to PRs Copilot opens, and GitHub's docs say it "has no effect if the ruleset requires zero approvals."
  • gh pr merge --auto needs contents: write and pull-requests: write, which the job already has. It needs no approval when none is required. Dependabot PRs here already merge as github-actions[bot] through this path.
  • Leaving the step in would break auto-merge after the flip. The step would fail and stop the job, so the auto-merge step would never run.

Nothing else changes: the same update types and ecosystems are auto-merged, and the required checks still gate the merge.


Summary by cubic

Removes the step that approves Dependabot PRs with GITHUB_TOKEN so the auto-merge job keeps working after the org disables GitHub Actions from approving pull requests.

The branch requires no approving review, so the approval has no effect on merges. Once the org turns off "Allow GitHub Actions to create and approve pull requests," the approval step would fail and stop the job before it enables auto-merge. Auto-merge itself stays unchanged.

Written for commit e9c97df. Summary will update on new commits.

View guided diff Turn on auto-fix

main requires no approving review, so the approval does nothing for the
merge. Once the org stops letting Actions approve pull requests, the step
fails and the job stops before it turns on auto-merge. Auto-merge stays as
it is.
@jeremy
jeremy requested a review from a team as a code owner November 20, 2026 04:50
Copilot AI balanced review requested due to automatic review settings November 20, 2026 04:50
@github-actions github-actions Bot added the ci label Nov 20, 2026
@github-actions

Copy link
Copy Markdown

Sensitive Change Detection (shadow mode)

This PR modifies control-plane files:

  • .github/workflows/dependabot-auto-merge.yml

Shadow mode — this check is informational only. When activated, changes to these paths will require approval from a maintainer.

Copilot AI left a comment

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.

🟢 Approved

No active review issues remain for the Dependabot workflow change.

No open issues 🎉

What changed in this PR

Removes Dependabot’s automatic approval step so the workflow can continue enabling auto-merge after the organization disables pull request approvals by GitHub Actions.

Changes:

  • Deletes the gh pr review --approve step that uses GITHUB_TOKEN.
  • Leaves auto-merge behavior unchanged for patch and minor updates, excluding GitHub Actions updates.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
.github/​workflows/​dependabot-auto-merge.yml Removes automatic approval while retaining the existing auto-merge step and filters.

Review effort: Balanced

@jeremy
jeremy merged commit 070aa43 into main Nov 21, 2026
24 of 26 checks passed
@jeremy
jeremy deleted the actions-drop-dependabot-approval branch November 21, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants