Claude Code GitHub Actions: 8 Secure Workflows + Linter

Add Claude to your pull requests and issues without opening a hole in your CI.

Claude Code GitHub Actions: 8 Secure Workflows + Linter product illustration

The 8 workflows

WorkflowTriggerClaude canToken permissions
claude-pr-review.ymlPR opened/updated (not drafts, not forks)inline + summary comments onlycontents read, pull-requests write
claude-mention.yml@claude in an issue, PR comment or reviewanswer and push commits to a branch (the action checks the commenter has write access)contents/pull-requests/issues write
claude-issue-triage.ymlissue openedadd existing labels, flag duplicatescontents read, issues write
claude-ci-failure-explainer.ymlyour CI workflow fails on a PRread failed logs, comment the cause + a suggested diffcontents read, actions read, pull-requests write
claude-security-review.ymlPR touches auth, API, SQL, migrations, Dockerfiles, workflows, manifestssecurity findings as inline commentscontents read, pull-requests write
claude-fork-pr-review.ymlmaintainer adds the claude-review label to a fork PRread the PR through gh pr diff only; PR code is never checked out or runcontents read, pull-requests write
claude-weekly-maintenance.ymlMonday 13:00 UTC + manualopen one "Weekly repo health" issuecontents read, issues write
claude-docs-sync.ymlPR changes src/api, src/cli or OpenAPIcomment exact doc editscontents read, pull-requests write

Quick start

python3 tools/install.py /path/to/repo --dry-run
python3 tools/install.py /path/to/repo --only pr-review --only issue-triage --only ci-failure-explainer --ci-workflow "Tests"

Then: add an ANTHROPIC_API_KEY repository secret (or run /install-github-app in Claude Code, which also installs the Claude GitHub App), create the claude-review label if you use the fork workflow, and run the linter. Existing workflow files are kept unless you pass --force (a .bak is saved).

Bedrock, Vertex AI or Foundry: replace anthropic_api_key with the provider inputs from the action's cloud-providers guide; the linter accepts those.

Security choices

What "hardened" means here, in every workflow:

  • actions pinned to full commit SHAs (claude-code-action v1 and actions/checkout v7.0.1, Nov 2026), with the version in a comment
  • least-privilege permissions: per job, timeout-minutes, and a concurrency group so rapid pushes cancel the old paid run
  • --max-turns caps on every run and --allowedTools lists of exact commands (Bash(gh pr diff:*)), never open Bash
  • no untrusted text (issue titles, PR bodies, comments, branch names) pasted into prompts or shell steps; prompts tell Claude to treat that content as data
  • workflow_run and pull_request_target never check out PR code at the workspace root (the CI explainer puts it in pr-head/ and passes --add-dir, as the action's security guide recommends)

Lint your workflows

python3 tools/claude_action_lint.py .github/workflows            # exit 1 on errors
python3 tools/claude_action_lint.py .github/workflows --strict   # also fail on warnings (for CI)

Errors: PR head checked out at the workspace root on pull_request_target / workflow_run; untrusted github.event text inside run:; permissions: write-all; API keys written in the file or not read from secrets; no authentication input; --dangerously-skip-permissions on PR/comment events; allowed_non_write_users without github_token: ${{ secrets.GITHUB_TOKEN }} (or with a personal access token), or set to * while Claude has write access. Warnings: unpinned actions, no permissions block, no timeout-minutes, no concurrency on PR workflows, no --max-turns, open Bash in --allowedTools, untrusted text pasted into the prompt, allowed_bots: '*', claude-code-base-action on PR/comment events (no actor checks). Info: fork PRs that will fail for lack of secrets; comment-triggered jobs without an if: filter.

--json gives machine-readable results with file, job and line.

Demo output (preview)

The screenshot is real output from the kit’s own commands. Tested from a fresh download of this exact zip: ./run_tests.sh ran 15 tests OK on Python 3.13 and 3.10.

Real terminal output from Claude Code GitHub Actions: 8 Secure Workflows + Linter: demo and passing tests

./tools/demo.sh lints the 8 workflows (0 errors, 0 warnings), lints examples/bad-workflows (2 files, 8 errors, 13 warnings), installs 3 workflows into a temp repo and lints them with --strict.

How it was tested

./run_tests.sh (15 tests, Python 3.9+): all 8 workflows parse and lint clean in strict mode; every job has permissions, a timeout of 30 minutes or less, one pinned Claude step with --max-turns and the key from secrets; only the @claude workflow can write code; the fork workflow never checks out PR code; no untrusted text in prompts; each linter rule fires on a bad example and stays quiet on the safe version; installer and CLI exit codes; the demo runs.

Honest limits

  • These workflows and the linter reduce risk; they don't make prompt injection impossible. Keep permissions minimal and review what Claude posts or pushes.
  • The linter reads workflow YAML statically (no anchors/aliases); it does not run your workflows or call GitHub.
  • Costs depend on your model, PR size and turn caps; check your Anthropic usage after the first week.
  • Written against claude-code-action v1 docs as of November 2026. When you update the pinned SHA, re-run the linter.

Format and license

Zip, 25 KB, v1.0, 18 files. You may use and modify this kit for your own work and for clients you serve, including paid client work. Not affiliated with or endorsed by Anthropic or GitHub.

FAQ

What does it cost to run?
Your Anthropic API (or Bedrock/Vertex) usage plus GitHub Actions minutes; the workflows set max turns to keep runs bounded.
Are fork PRs safe?
fork-pr-review starts only when a maintainer adds a label, never checks out or runs the fork's code, and reads the change through gh pr diff with a short tool allowlist.
Can I lint workflows I already have?
Yes: python3 tools/claude_action_lint.py .github/workflows.
How do I get the files?
Pay by card right here on youraitools.co: your download links appear on this page the moment the payment goes through (claim window: 72 hours, up to 5 downloads per 7 days). Need the files re-sent later? Email hello@youraitools.co.
Refunds?
Email hello@youraitools.co within 14 days if it doesn’t work and we can’t fix it.
Can I pay with crypto?
Yes. Pay the same price in USDC or USDT on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana from the "Pay with crypto" button, with no account or KYC. We check the payment on-chain and show your download links as soon as it confirms.

Get Claude Code GitHub Actions: 8 Secure Workflows + Linter

8 secure claude-code-action workflows: PR review, @claude mentions, issue triage, CI failure fixes, security review, fork-safe review, plus a linter.

Pairs well with

Download$19

Claude Code Safety Hooks

Tested Claude Code hooks as a plugin: block rm -rf and force-push to main, protect .env and lockfiles, catch API keys in files, audit log. $19 once.

View Claude Code Safety Hooks
DownloadFree

Claude Code Hooks Starter (Free)

Free Claude Code hooks examples: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Notification and Stop, plus a local tester that checks your hook's output.

View Claude Code Hooks Starter (Free)
Download$12

Cursor Rules Pack

24 Cursor rules (.mdc) for Next.js, TypeScript, React, Python, FastAPI, Django, Go, Rust and more. Detects your stack, installs in one command, lints your rules. $12 once.

View Cursor Rules Pack

Related

1 email a week: new x402 + MCP tools and free kits.

Short weekly digest of new x402 + MCP tools and free kits, including the MCP OAuth Checker. No spam, unsubscribe any time.