fix: least-privilege permissions and scope trigger to main in dependabot-automerge workflow - #48
Merged
Merged
Conversation
Co-authored-by: don-petry <36422719+don-petry@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [PR-39] Address review comments and implement requested changes
fix: least-privilege permissions and scope trigger to main in dependabot-automerge workflow
Mar 11, 2026
don-petry
approved these changes
Mar 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Dependabot auto-merge GitHub Actions workflow to follow least-privilege permissions while keeping the existing auto-merge behavior for Dependabot PRs targeting main.
Changes:
- Restricts the workflow trigger to
pull_requestevents targeting themainbranch. - Reduces default (workflow-level) token permissions to read-only.
- Grants write permissions only to the specific
dependabotjob that performs the merge.
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.
Addresses two review comments from PR #39 on the Dependabot automerge workflow.
Changes
contents,pull-requests) moved from workflow level to job level. Workflow-level is now read-only, limiting the blast radius of theGITHUB_TOKENfor non-Dependabot PR events.on: pull_request→ scoped tobranches: [main], consistent with all other workflows in the repo.Note: bypass merge (no approval required)
This is a GitHub admin setting — not configurable via code. A repo admin must either add
dependabot[bot]to the bypass list in the branch ruleset, or reduce required approvals to 0 under Settings → Rules → Rulesets (or Settings → Branches for classic branch protection).Original prompt
This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.