ci: automate dependabot minor/patch updates - #554
Merged
Conversation
| @@ -0,0 +1,24 @@ | |||
| name: Dependabot auto-merge | |||
| on: pull_request | |||
Contributor
There was a problem hiding this comment.
Dependabot token blocks auto-merge
When Dependabot opens a minor or patch update, this pull_request workflow invokes gh pr merge with a read-only event token, causing the command to fail with insufficient permissions and leaving auto-merge disabled.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/dependabot-auto-merge.yml
Line: 2
Comment:
**Dependabot token blocks auto-merge**
When Dependabot opens a minor or patch update, this `pull_request` workflow invokes `gh pr merge` with a read-only event token, causing the command to fail with insufficient permissions and leaving auto-merge disabled.
How can I resolve this? If you propose a fix, please make it concise.| steps: | ||
| - name: Dependabot metadata | ||
| id: metadata | ||
| uses: dependabot/fetch-metadata@v2 |
Contributor
There was a problem hiding this comment.
Mutable action receives write token
The mutable dependabot/fetch-metadata@v2 reference receives a token with content and pull-request write permissions, so a compromised or repointed tag can modify repository content or pull requests. Pin the action to a reviewed full commit SHA.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/dependabot-auto-merge.yml
Line: 15
Comment:
**Mutable action receives write token**
The mutable `dependabot/fetch-metadata@v2` reference receives a token with content and pull-request write permissions, so a compromised or repointed tag can modify repository content or pull requests. Pin the action to a reviewed full commit SHA.
How can I resolve this? If you propose a fix, please make it concise.
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.
Sets up auto-merge for dependabot PRs targeting minor and patch versions. Note: you still need to enable Allow auto-merge in the repository settings for this to work.
Greptile Summary
Adds a GitHub Actions workflow that:
Confidence Score: 2/5
This PR should not merge until the workflow uses an event or trusted follow-up design that can actually enable auto-merge for Dependabot pull requests.
Dependabot-triggered pull-request runs receive a read-only token, while the workflow's core command requires pull-request write access, so eligible updates will fail instead of being enrolled in auto-merge; the mutable privileged action reference also warrants hardening.
Files Needing Attention: .github/workflows/dependabot-auto-merge.yml
Security Review
The workflow passes a write-capable token to an action referenced by a mutable major-version tag; pin the action to an immutable commit SHA.
What T-Rex did
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "ci: add dependabot auto-merge workflow" | Re-trigger Greptile