Skip to content

ericrisco/rsc-harness / skills/github-actions

github-actions

Verified

Use when authoring or fixing GitHub Actions CI/CD — workflows under .github/workflows, triggers, job matrix, caching, token permissions, OIDC cloud deploys, environment gates, reusable workflows. NOT the Dockerfile or image build strategy (that is `docker`), NOT the branching model (that is `git-workflow`), NOT release readiness (that is `ship`).

FileKindSize
SKILL.mdskill md13.1 KB
evals/README.mdmarkdown985 B
evals/cases.yamlconfig3.2 KB
references/caching-and-matrix.mdmarkdown3.9 KB
references/oidc-deploys.mdmarkdown4.6 KB
scripts/verify.shexecutablescript4.1 KB

scripts/verify.sh

View on GitHub
#!/usr/bin/env bash
# verify.sh — static lint for GitHub Actions workflows.
# Read-only. No network, no install, no run. Heuristic and advisory.
#
# Checks .github/workflows/*.{yml,yaml} in the target dir:
#   ERROR (exit 1): pull_request_target together with a checkout of the PR head
#                   (runs untrusted fork code with full secrets).
#   WARN: third-party uses: (not actions/* or github/*) not pinned to a 40-hex SHA.
#   WARN: a workflow with no permissions: block (default token may be write).
#   WARN: a step using secrets.AWS_/GCP_/AZURE_ creds while the file lacks id-token: write (OIDC nudge).
# Runs `actionlint` if it is on PATH and surfaces its output.
#
# Exits non-zero ONLY on ERROR, so it works as a CI gate.
# Exits 0 on a clean/empty target (no .github/workflows -> nothing to check).
#
# Usage: scripts/verify.sh [dir]   (defaults to current directory)
set -euo pipefail

DIR="${1:-.}"
ERRORS=0
WARN=0

if [ ! -d "$DIR" ]; then
  echo "verify.sh: '$DIR' is not a directory" >&2
  exit 2
fi

err()  { echo "ERROR: $*"; ERRORS=$((ERRORS + 1)); }
warn() { echo "WARN:  $*"; WARN=$((WARN + 1)); }

WF_DIR="$DIR/.github/workflows"
if [ ! -d "$WF_DIR" ]; then
  echo "verify.sh: no .github/workflows under '$DIR' — skill not applied yet, nothing to check."
  exit 0
fi

# bash 3.2 (macOS) friendly: newline-delimited list, no mapfile.
FILES="$(
  find "$WF_DIR" -maxdepth 1 -type f \( -name '*.yml' -o -name '*.yaml' \) 2>/dev/null
)"

if [ -z "$FILES" ]; then
  echo "verify.sh: .github/workflows has no .yml/.yaml files — nothing to check."
  exit 0
fi

# Optional: actionlint if available (advisory; its exit code does not gate us).
if command -v actionlint >/dev/null 2>&1; then
  echo "verify.sh: running actionlint..."
  actionlint "$WF_DIR"/*.yml "$WF_DIR"/*.yaml 2>/dev/null || \
    warn "actionlint reported issues (see above)."
else
  echo "verify.sh: actionlint not on PATH — running built-in checks only."
fi

while IFS= read -r f; do
  [ -z "$f" ] && continue

  # --- ERROR: pull_request_target + checkout of the PR head ---
  if grep -Eq 'pull_request_target' "$f"; then
    if grep -Eq 'github\.event\.pull_request\.head|head\.sha|head\.ref' "$f"; then
      err "$f uses pull_request_target AND checks out the PR head — runs untrusted code with secrets (RCE). Use pull_request, or never check out head.* here."
    fi
  fi

  # --- WARN: no permissions: block at all ---
  if ! grep -Eq '^[[:space:]]*permissions[[:space:]]*:' "$f"; then
    warn "$f has no permissions: block — the default GITHUB_TOKEN may be write. Set 'permissions: contents: read' and widen per job."
  fi

  # --- WARN: third-party uses: not pinned to a 40-hex SHA ---
  # Lines like:  - uses: owner/repo@ref   (ignore ./local and docker:// forms)
  while IFS= read -r line; do
    [ -z "$line" ] && continue
    ref="${line#*@}"                       # everything after the first @
    owner="${line%%/*}"                    # owner segment of the action path
    owner="${owner##*uses:}"
    owner="$(echo "$owner" | tr -d ' ')"
    # skip first-party actions/* and github/*
    case "$owner" in
      actions|github) continue ;;
    esac
    # accept exactly 40 hex chars (optionally followed by whitespace/comment)
    if ! echo "$ref" | grep -Eq '^[0-9a-fA-F]{40}([[:space:]]|#|$)'; then
      short="$(echo "$line" | sed -E 's/^[[:space:]]*-?[[:space:]]*uses:[[:space:]]*//' | cut -c1-60)"
      warn "$f: third-party action not SHA-pinned: $short — pin to a full 40-char commit SHA (tags are mutable; cf. tj-actions 2025)."
    fi
  done <<EOF
$(grep -E '^[[:space:]]*-?[[:space:]]*uses:[[:space:]]*[^./][^@]+@[^[:space:]]+' "$f" | grep -vE 'uses:[[:space:]]*\./|docker://' || true)
EOF

  # --- WARN: cloud secrets used but no id-token: write (OIDC nudge) ---
  if grep -Eq 'secrets\.(AWS|GCP|GOOGLE|AZURE)[A-Z_]*' "$f"; then
    if ! grep -Eq 'id-token[[:space:]]*:[[:space:]]*write' "$f"; then
      warn "$f references cloud secrets (AWS/GCP/AZURE) but sets no 'id-token: write' — prefer OIDC over long-lived keys."
    fi
  fi
done <<EOF
$FILES
EOF

echo
echo "verify.sh: $ERRORS error(s), $WARN warning(s)."
[ "$ERRORS" -gt 0 ] && exit 1
exit 0
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 319kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall