{"name":"review-github-actions-security","description":"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.","category":"deployment","tags":["security","github-actions"],"models":["any"],"proven":false,"passing_families":0,"model_testing":"Not yet model-tested; testing Jan 2027","url":"https://theskillvault.ai/skills/review-github-actions-security","api_url":"https://theskillvault.ai/api/skills/review-github-actions-security","raw_url":"https://theskillvault.ai/api/skills/review-github-actions-security/raw","body":"# Review GitHub Actions security\n\nA 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.\n\n## When to use\n- Someone asks whether a workflow is safe to merge.\n- A job uses `pull_request_target`, `workflow_run` or `issue_comment`.\n- Third-party actions are referenced by a tag or a branch name.\n\n## When not to use\n- The task is to add lint and tests on each push. That is a CI setup task.\n- The task is to cut minutes or spend. That is a cost review.\n- The failure is a red check and the user wants the log explained. Fix the check first.\n\n## Steps\n1. Read every `on:` trigger. `pull_request` from a fork gets a read-only token and no secrets. `pull_request_target`, `workflow_run` and `issue_comment` run with the base repo's token and its secrets, and an outsider can fire them.\n2. 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 unprivileged `pull_request` job runs the untrusted code, and a later job only reads its result.\n3. Treat `${{ }}` inside `run:` as pasted text, not as a variable. Move untrusted values into `env:` and read them as `\"$TITLE\"` in the script. Issue titles, pull-request bodies, branch names and comment bodies are untrusted.\n4. Set `permissions` at the top. Prefer `contents: read`. Grant a write scope only on the job that needs it. Flag a missing block and flag `write-all`.\n5. Pin third-party `uses:` to a full 40-character commit SHA, with the version in a trailing comment. A tag or `@main` can be moved. First-party `actions/*` are lower risk. SHA pins are still safer.\n6. Do not print secrets. Do not pass secrets into a step that runs untrusted code. Set `persist-credentials: false` on checkout when a later step runs code you do not trust.\n7. Prefer GitHub-hosted runners for a public repo. A self-hosted runner can keep files from a previous untrusted job.\n8. Report findings with the file, the line, the risk and a corrected snippet. Do not change the workflow until the user accepts the fix.\n\n```yaml\npermissions:\n  contents: read\njobs:\n  show:\n    runs-on: ubuntu-latest\n    steps:\n      - env:\n          TITLE: ${{ github.event.issue.title }}\n        run: printf '%s\\n' \"$TITLE\"\n```\n\n## Gotchas\n- A normal `pull_request` job 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.\n- Writing raw user text to `$GITHUB_ENV` or `$GITHUB_OUTPUT` can inject extra lines. Pass it through an env var instead.\n- 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.\n- SHA pins do not update themselves. Bump them on purpose and read the diff.\n\n## Portability\nThese 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.\n\n## Done when\n- No untrusted `${{ }}` sits inside a `run:` script.\n- Privileged triggers do not execute fork code.\n- `permissions` is set, third-party actions are SHA-pinned, and no secret is printed.\n\n## Example prompt\n\"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.\"\n\n---\nAdapted from \"github-actions-hardening\" in github/awesome-copilot (MIT, Copyright GitHub, Inc.). See LICENSE.txt.","files":["LICENSE.txt"],"license":"MIT","license_name":"MIT License","license_url":"https://opensource.org/license/mit","attribution":"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","install":{"claude_code":"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":"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'","agents":"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'","mcp_url":"https://theskillvault.ai/mcp","cursor_mcp_deeplink":"cursor://anysphere.cursor-deeplink/mcp/install?name=theskillvault&config=eyJ1cmwiOiJodHRwczovL3RoZXNraWxsdmF1bHQuYWkvbWNwIn0%3D","mcp_config":{"mcpServers":{"theskillvault":{"url":"https://theskillvault.ai/mcp"}}}},"bundles":[],"tested_on":[{"family":"chatgpt","name":"ChatGPT","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"claude","name":"Claude","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"gemini","name":"Gemini","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"grok","name":"Grok","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"llama","name":"Llama","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"deepseek","name":"DeepSeek","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"mistral","name":"Mistral","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"qwen","name":"Qwen","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"kimi","name":"Kimi K","outcome":null,"date":null,"source":null,"counts":false,"stale":false}],"proven_rule":{"threshold":5,"window_days":365,"computed_at":"2026-11-29T03:42:30.374Z"}}