Repository navigation
ci: grant contents:write to dependabot-automerge (fix runtime-denied merge) #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hyperpolymath
merged 3 commits into
main
from
claude/dependabot-automerge-contents-write
Nov 10, 2026
+1
−1
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
2ed14a9
ci: grant contents:write to dependabot-automerge (fix runtime-denied …
claude 476e135
Merge branch 'main' into claude/dependabot-automerge-contents-write
hyperpolymath 81c643b
Merge branch 'main' into claude/dependabot-automerge-contents-write
hyperpolymath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: hyperpolymath/anytype
Length of output: 10290
Web query:
GitHub Actions Dependabot pull_request GITHUB_TOKEN read only write token repository settings send write tokens workflowsResult:
Web query:
GitHub Actions pull_request event workflow file from pull request merge commit workflow changes run before merge documentationResult:
Web query:
site:docs.github.com how GitHub determines which workflow to run associated commit SHA workflow file event pull request merge commitResult:
Keep proposed action updates away from the write token.
Dependabot can update
dependabot/fetch-metadatain this workflow. Apull_requestrun uses the proposed workflow, so the updated action can receivecontents: writebefore review. A compromised release could use that token to modify unprotected refs or releases.Run the privileged merge decision from trusted base-branch code.
zizmor (1.31.1)
[error] 45-45: overly broad permissions (excessive-permissions): contents: write is overly broad at the workflow level
(excessive-permissions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid security point — verified, and leaving this thread open for the maintainer to decide, because it's a genuine design tension on an estate-owned workflow, not something to silently restructure in a one-line PR.
What I confirmed:
on: pull_request(notpull_request_target) runs the workflow from the PR merge ref, so a Dependabot PR that bumps an action used here would execute that proposed action under this job.permissions, socontents: writeis live for them.github.actor == 'dependabot[bot]', anddependabot/fetch-metadatais SHA-pinned here. (Note: the systemet copy in #93 pins it only by@v3.1.0tag — weaker; worth SHA-pinning there regardless.)The tension: this same
contents: writeis exactly what the Hypatia gate flags as required — withcontents: readthegh pr merge --autostep is denied at runtime, so auto-merge silently never happens. So "drop the write" isn't an option while the owner's stated policy is auto-merge-everything.The robust fix is the split you describe: a read-only
pull_requestjob that only evaluates policy + uploads metadata, and a trustedworkflow_run/pull_request_targetjob (base-branch code,contents: write) that performs the merge and never executes PR-proposed code. That's a "Heavy lift" redesign of a template-owned workflow that's identical across the estate — so it's a deliberate maintainer decision (do the split estate-wide, or accept the documented risk the workflow header already scopes out as the "compromised Dependabot / Akerlof" case), not a change I'll push unilaterally onto this minimal fix. Deferring to @hyperpolymath; thread stays open.Generated by Claude Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hyperpolymath Thank you for confirming the risk. I agree that the workflow redesign needs a maintainer decision. I will leave this thread open.
I recommend fixing the privilege boundary before merging. If the maintainer defers the fix, they should explicitly accept and document the risk. They should also verify the Dependabot token permissions and required checks in the repository settings.
If the fix uses
workflow_run, the privileged workflow must treat uploaded metadata as untrusted. It should revalidate the PR identity, head SHA and policy without executing PR-proposed code.Would you like me to open a follow-up issue for the estate-wide redesign?
You are interacting with an AI system.