Repository navigation
Stop approving Dependabot PRs with GITHUB_TOKEN - #667
Merged
Merged
Conversation
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.
Sensitive Change Detection (shadow mode)This PR modifies control-plane files:
|
Contributor
There was a problem hiding this comment.
🟢 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 --approvestep that usesGITHUB_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 rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
.github/workflows/dependabot-auto-merge.yml |
Removes automatic approval while retaining the existing auto-merge step and filters. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
basecamporg is about to turn off "Allow GitHub Actions to create and approve pull requests" (Security Hardening, step 4). After that,gh pr review --approvewithGITHUB_TOKENfails.This PR deletes the step in
dependabot-auto-merge.ymlthat approves Dependabot's patch and minor bumps withGITHUB_TOKEN. The step that turns on auto-merge stays as it was.Why the approval can go:
mainrequires no approving review. Read today fromGET /repos/basecamp/hey-cli/rules/branches/main: everypull_requestrule hasrequired_approving_review_count: 0, and the branch has no classic protection.require_extra_approval_for_unattributed_changesapplies only to PRs Copilot opens, and GitHub's docs say it "has no effect if the ruleset requires zero approvals."gh pr merge --autoneedscontents: writeandpull-requests: write, which the job already has. It needs no approval when none is required. Dependabot PRs here already merge asgithub-actions[bot]through this path.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_TOKENso 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.