Skip to content

Secure Claude workflows#25724

Draft
iangmaia wants to merge 5 commits into
trunkfrom
iangmaia/secure-claude-workflows
Draft

Secure Claude workflows#25724
iangmaia wants to merge 5 commits into
trunkfrom
iangmaia/secure-claude-workflows

Conversation

@iangmaia

@iangmaia iangmaia commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Gate @claude triggers to trusted commenters and skip Claude workflows on fork/external PRs before checkout or Claude execution.
  • Pin mutable action references and preserve the Claude action's required OIDC permission for GitHub App token exchange.
  • Keep review feedback inline-only where the workflow does not grant issue-comment permissions.

@iangmaia iangmaia self-assigned this Jul 1, 2026
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number32986
VersionPR #25724
Bundle IDorg.wordpress.alpha
Commite03cd09
Installation URL1jjojc9uf92rg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number32986
VersionPR #25724
Bundle IDcom.jetpack.alpha
Commite03cd09
Installation URL1u91lodk0oj98
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hardens the claude-review GitHub Actions workflow by preventing Claude execution (and repository checkout) on external/fork PRs, and by pinning action references to immutable SHAs. This keeps the automated review surface area smaller for untrusted issue_comment events while maintaining inline-only review behavior.

Changes:

  • Add a pre-check step that queries the PR’s head repository and skips the workflow for external/fork PRs before checkout/Claude execution.
  • Pin actions/checkout and anthropics/claude-code-action to specific commit SHAs, and disable credential persistence on checkout.
  • Update the prompt/input wiring for issue_comment events and restrict Claude’s allowed tools to inline-only feedback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +19 to +25
- name: Check PR origin
id: pr-origin
env:
GH_TOKEN: ${{ github.token }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPOSITORY: ${{ github.repository }}
run: |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e03cd09. The PR-origin lookup now runs in a low-permission preflight job gated to trusted commenters; the Claude job with write/OIDC permissions only starts for trusted same-repo PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants