secure-github-action

Pin GitHub Actions to commit SHAs and enforce minimal permissions.

Updated Jan 2, 2026
One-click install
npx skills add https://github.com/tacogips/claude-code-agent --skill secure-github-action
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secure-github-action
Source: https://github.com/tacogips/claude-code-agent/tree/main/.claude/skills/secure-github-action
Command: npx skills add https://github.com/tacogips/claude-code-agent --skill secure-github-action

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill secures GitHub Actions workflows by pinning all action references to full commit SHAs and enforcing safer configurations.

Core Features & Use Cases

  • Pin all actions to full commit SHAs to prevent drift and supply-chain risks.
  • Enforce minimal permissions at workflow and job levels to limit blast radius.
  • Harden checkout and prevent unsafe script injection by safe env usage and controlled run contexts.
  • Use cases: teams migrating sensitive CI pipelines to enforce security standards across multiple repos.

Quick Start

Apply core security steps to your workflows: pin SHAs, set permissions, and avoid pull_request_target for privileged operations. Then update your workflow files against these guidelines.

Frequently Asked Questions about secure-github-action

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pin GitHub Actions to a commit SHA to secure my workflows?

To secure GitHub Actions workflows, you pin all action references to full commit SHAs instead of mutable tags or branches. This prevents supply-chain risks by ensuring the workflow always runs the exact, auditable code version you expect.

Why should I avoid pull_request_target in GitHub Actions workflows?

You should avoid the pull_request_target trigger for privileged operations because it runs with write access to the repository. Using it with untrusted code can lead to script injection, so safer checkout practices and controlled run contexts are enforced instead.

What are the best practices for setting minimal permissions in GitHub Actions?

Best practices for minimal permissions in GitHub Actions involve explicitly setting least-privilege access at both the workflow and job levels. This limits the blast radius of potential security breaches by restricting what the automated process can modify.

How do I prevent script injection in GitHub Actions workflows?

You prevent script injection in GitHub Actions by using safe environment variables and avoiding risky contexts for untrusted inputs. Hardening the checkout process and controlling run contexts ensures that malicious pull requests cannot execute arbitrary commands.

Can I use this approach to enforce security standards across multiple repositories?

Yes, this approach is designed for teams migrating sensitive CI pipelines to enforce security standards across multiple repositories. It provides validated, auditable workflow configurations that apply supply-chain security practices uniformly.

What is the process for hardening checkout in GitHub Actions?

Hardening checkout in GitHub Actions involves configuring safe environment usage and controlled run contexts during repository cloning. This prevents unsafe script injection and ensures the workflow operates within a secure, minimal permission scope.