gha-sha-reference

Convert GitHub Actions uses tag references to SHA references in YAML workflow files.

11|Updated Jul 11, 2025
One-click install
npx skills add https://github.com/syou6162/claude-code-commands --skill gha-sha-reference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gha-sha-reference
Source: https://github.com/syou6162/claude-code-commands/tree/main/skills/gha-sha-reference
Command: npx skills add https://github.com/syou6162/claude-code-commands --skill gha-sha-reference

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automatically converts tag references in actions uses fields to immutable SHAs (with the version tag) to improve security and reproducibility.

Core Features & Use Cases

  • Initial check: Identify unpinned actions with pinact --check --diff
  • Conversion: Retrieve commit SHAs and append version tags as comments
  • Automation: Update workflows in .github/workflows to pin actions
  • Use case: Teams adhering to GitHub Actions security guidelines by ensuring all actions are pinned to a specific SHA.

Quick Start

例: uses: actions/checkout@v4 → uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 これを実行するには、まず pinact run --check --diff で対象を確認し、その後 pinact run で変換を適用します。

Frequently Asked Questions about gha-sha-reference

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

FAQPage Schema
How do I pin GitHub Actions to SHA references instead of version tags?

Pinning GitHub Actions to SHA references replaces unpinned tag references like `v4` with immutable commit SHAs to improve security and reproducibility. This skill automatically converts `uses: actions/checkout@v4` to `uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0`, appending the version tag as a comment for clarity.

What's the security benefit of converting GitHub Actions to SHA references?

SHA references prevent tag hijacking and ensure workflows always run the exact intended action version. Tags can be reassigned or deleted, but SHAs are immutable, protecting your CI/CD pipeline from unexpected changes or malicious updates to action repositories.

How do I check which actions in my workflows are unpinned before converting them?

Run `pinact --check --diff` to identify all unpinned actions in `.github/workflows/*.yml` and `action.*.yml` files. This preview shows which `uses:` references need conversion without applying changes, letting you review the scope before proceeding.

Can this skill automatically update all workflow files at once?

Yes, the skill auto-detects and converts all applicable YAML files in `.github/workflows` and action configuration files. After previewing with `--check --diff`, run `pinact run` to apply SHA conversions across your entire workflow suite in a single operation.

Does pinning actions with SHAs affect readability or maintenance?

The skill preserves readability by appending the version tag as a comment (e.g., `# v4.3.0`), so maintainers can still identify the action version at a glance while benefiting from SHA immutability and enhanced security.