.agents/skills/secure-github-action/SKILL.md
Use this skill when creating or modifying GitHub Actions workflow files (.github/workflows/*.yml). Ensures all actions are pinned by commit SHA, permissions are minimized, script injection is prevented, and other supply chain security best practices are applied.
npx skillsauth add tacogips/codex-agent secure-github-actionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When creating or modifying a GitHub Actions workflow, follow ALL steps below. Read references/security-rules.md for the full rule set.
For every uses: line, resolve the tag/branch to its full 40-character commit SHA.
How to resolve SHAs:
# For a tagged release (e.g. actions/[email protected])
gh api repos/{owner}/{repo}/git/ref/tags/{tag} --jq '.object.sha'
# If the above returns a tag object (not commit), dereference it:
gh api repos/{owner}/{repo}/git/tags/{tag_sha} --jq '.object.sha'
# For a branch reference (e.g. @main)
gh api repos/{owner}/{repo}/git/ref/heads/{branch} --jq '.object.sha'
Always check the latest stable release first:
gh api repos/{owner}/{repo}/releases/latest --jq '.tag_name'
Output format - always add a human-readable version comment:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Workflow-level: default to read-only or nothing
permissions:
contents: read
# Job-level: override only where needed
jobs:
deploy:
permissions:
contents: write
deployments: write
permissions: {} for jobs needing no GitHub API accesspermissions: write-all- uses: actions/checkout@{SHA} # vX.Y.Z
with:
persist-credentials: false # unless the job needs to push
Set persist-credentials: false for all jobs that do NOT need to git push.
NEVER interpolate ${{ github.event.* }} directly in run: blocks. Use env: intermediaries:
# BAD - shell injection via PR title
- run: echo "${{ github.event.pull_request.title }}"
# GOOD - safe via env variable
- env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "$PR_TITLE"
Dangerous contexts: github.event.issue.title, .body, github.event.pull_request.title, .body, .head.ref, github.event.comment.body, github.event.commits.*.message, github.head_ref.
pull_request_target pitfallspull_request over pull_request_targetpull_request_target is used, NEVER checkout ${{ github.event.pull_request.head.sha }}pull_request + workflow_run)timeout-minutes on jobscancel-in-progress: false) and CI (cancel-in-progress: true)secrets: inherit in reusable workflows; pass secrets explicitlyAfter generating the workflow, verify:
uses: line has a full 40-char SHA (no @v4, @main, @latest)permissions: block exists at workflow or job level${{ github.event.* }} appears directly in any run: blockpersist-credentials: false is set where push is not neededtimeout-minutes is set on all jobsIf $ARGUMENTS is a file path, read it and apply hardening. If it's a description, create a new workflow following all rules above.
development
Use when writing, reviewing, or refactoring TypeScript code. Provides type safety patterns, error handling, project layout, and async programming guidelines.
development
Use when refactoring tests for better maintainability. Provides guidelines for removing duplicates, DRYing fixtures/assertions, restructuring test organization, renaming, and splitting oversized files.
testing
Use when creating test plans from implementation and design documents. Provides test plan structure, test case tracking, and coverage guidelines.
development
Use when creating, publishing, or maintaining npm packages with Bun. Provides Shai-Hulud supply chain attack countermeasures including npm token management, 2FA enforcement, provenance signing, trusted publishing via GitHub Actions, and pre-publish security checklists.