Deployment and dev setup · Skill
Review GitHub Actions security
review-github-actions-security
Reviews GitHub Actions workflow files for script injection, privileged triggers, broad token scopes and mutable action refs. Use when the user asks if a workflow is safe, wants third-party actions pinned to a commit SHA, or uses pull_request_target.
Works with: Any AI Not yet model-tested; testing Jan 2027
Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works
Install in Claude Code, Cursor or Codex (optional)
Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.
Claude Code (all your projects)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/review-github-actions-security/raw' -o ~/'.claude/skills/review-github-actions-security/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/review-github-actions-security/files/LICENSE.txt' -o ~/'.claude/skills/review-github-actions-security/LICENSE.txt'Cursor (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/review-github-actions-security/raw' -o '.cursor/skills/review-github-actions-security/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/review-github-actions-security/files/LICENSE.txt' -o '.cursor/skills/review-github-actions-security/LICENSE.txt'Codex and other Agent Skills tools (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/review-github-actions-security/raw' -o '.agents/skills/review-github-actions-security/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/review-github-actions-security/files/LICENSE.txt' -o '.agents/skills/review-github-actions-security/LICENSE.txt'
Or connect the whole library over MCP
Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):
{
"mcpServers": {
"theskillvault": {
"url": "https://theskillvault.ai/mcp"
}
}
}A workflow can run attacker-controlled text as shell. The risky part is the YAML, not the product code. Review the trigger, then the expressions, then the token, then the action refs.
When to use
- Someone asks whether a workflow is safe to merge.
- A job uses
pull_request_target,workflow_runorissue_comment. - Third-party actions are referenced by a tag or a branch name.
When not to use
- The task is to add lint and tests on each push. That is a CI setup task.
- The task is to cut minutes or spend. That is a cost review.
- The failure is a red check and the user wants the log explained. Fix the check first.
Steps
- Read every
on:trigger.pull_requestfrom a fork gets a read-only token and no secrets.pull_request_target,workflow_runandissue_commentrun with the base repo's token and its secrets, and an outsider can fire them. - Flag a privileged trigger that checks out a fork ref and then runs that code (
npm install, a build, or any lifecycle script). Split it: an unprivilegedpull_requestjob runs the untrusted code, and a later job only reads its result. - Treat
${{ }}insiderun:as pasted text, not as a variable. Move untrusted values intoenv:and read them as"$TITLE"in the script. Issue titles, pull-request bodies, branch names and comment bodies are untrusted. - Set
permissionsat the top. Prefercontents: read. Grant a write scope only on the job that needs it. Flag a missing block and flagwrite-all. - Pin third-party
uses:to a full 40-character commit SHA, with the version in a trailing comment. A tag or@maincan be moved. First-partyactions/*are lower risk. SHA pins are still safer. - Do not print secrets. Do not pass secrets into a step that runs untrusted code. Set
persist-credentials: falseon checkout when a later step runs code you do not trust. - Prefer GitHub-hosted runners for a public repo. A self-hosted runner can keep files from a previous untrusted job.
- Report findings with the file, the line, the risk and a corrected snippet. Do not change the workflow until the user accepts the fix.
permissions:
contents: read
jobs:
show:
runs-on: ubuntu-latest
steps:
- env:
TITLE: ${{ github.event.issue.title }}
run: printf '%s\n' "$TITLE"
Gotchas
- A normal
pull_requestjob from a fork is not critical by itself. It cannot read secrets. Reserve the highest severity for privileged triggers and for injection on those triggers. - Writing raw user text to
$GITHUB_ENVor$GITHUB_OUTPUTcan inject extra lines. Pass it through an env var instead. - A secret, cloud key or API token must not be echoed. Prefer a short-lived OIDC token over a long-lived cloud key stored in the repo.
- SHA pins do not update themselves. Bump them on purpose and read the diff.
Portability
These rules are for GitHub Actions. If you use GitLab CI or another runner, the same rule holds: untrusted input must not be pasted into a shell, and the job token should be as small as the job.
Done when
- No untrusted
${{ }}sits inside arun:script. - Privileged triggers do not execute fork code.
permissionsis set, third-party actions are SHA-pinned, and no secret is printed.
Example prompt
"Review .github/workflows/ci.yml. It uses pull_request_target and checks out the fork head. Tell me what is unsafe and show a safer snippet."
---
Adapted from "github-actions-hardening" in github/awesome-copilot (MIT, Copyright GitHub, Inc.). See LICENSE.txt.
Bundled files
Licence
Adapted from GitHub awesome-copilot contributors (github-actions-hardening) (Copyright GitHub, Inc.), MIT License. Adapted by TheSkillVault: rewritten as a short review order (triggers, injection, permissions, SHA pins, secrets) with one original example; dropped the reference-file catalogue and severity emoji table; added gotchas and done-when.
Licence: MIT License. Attribution when you reuse it: Based on work by GitHub awesome-copilot contributors (github-actions-hardening) (Copyright GitHub, Inc., MIT License), https://github.com/github/awesome-copilot/tree/5269f7ea2d6c3a9bfda5ed878b6726cf509121fd/skills/github-actions-hardening; adapted by TheSkillVault, https://theskillvault.ai