Stop approving Dependabot PRs with GITHUB_TOKEN

Merged
JE
13h ago
+1-13

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/basecamp-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 Dependabot approval step that used GITHUB_TOKEN, so auto-merge keeps working after the org disables GitHub Actions from approving pull requests.

  • main requires no approving reviews, so the approval had no effect on merging.
  • The auto-merge step is unchanged and still runs only after required checks pass.