Harden respond-to-comment.yml against fork PRs#14
Closed
hongyi-chen wants to merge 1 commit intomainfrom
Closed
Conversation
Adds a fork-guard step before checkout/agent/push, and pins warpdotdev/oz-agent-action from the floating @v1 tag to a commit SHA in both workflows. Co-Authored-By: Oz <oz-agent@warp.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Hardens the
@oz-agentworkflow surface in this repo against the same forked-PR exploit chain that was demonstrated in oz-for-oss: a maintainer commenting@oz-agenton a fork PR was sufficient to execute fork-controlled code on a runner holdingWARP_API_KEYand acontents: writeGITHUB_TOKEN, then push back upstream.Changes
.github/workflows/respond-to-comment.ymlCheck PR is not from a forkstep as the first job step. It loads the PR viagithub.rest.pulls.get, posts a friendly decline comment back to the author whenpr.head.repo.full_namedoesn't match the upstream repo, andcore.setFaileds before any checkout, agent invocation, orgit push. This runs ahead of the existing commenter-permission check, so fork PRs are rejected even when a maintainer triggers them.warpdotdev/oz-agent-actionfrom the floating@v1tag to commit SHAce1621abf6a8ed8afdd4e4cc994545ede8fe1c6f # v1.0.12..github/workflows/review-pr.ymlwarpdotdev/oz-agent-actionfrom the floating@v1tag to commit SHAce1621abf6a8ed8afdd4e4cc994545ede8fe1c6f # v1.0.12. The existing job-levelif: github.event.pull_request.head.repo.full_name == github.repositoryalready gates fork PRs.Out of scope
WARP_API_KEYrotation. Tracked separately.AGENTS.mdonce we have repo-wide guidance written down for any new agent workflow.Validation
Co-Authored-By: Oz oz-agent@warp.dev
Conversation · Plan