Use this when using reusable actions in GitHub Actions workflows.
Actions · GitHub Actions
Actions are reusable steps in GitHub Actions workflows, referenced with uses: such as actions/checkout@v4. Pin third-party actions to a full commit SHA to protect against tampered tags.
1. Actions are reusable steps (marketplace or local).
2. Pin to commit SHAs.
3. Review third-party actions.
4. Dependabot updates.
5. Restrict allowed actions in org settings.
uses: action@sha → executes in job
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Validate metadata syntax and run the action in a fixture workflow with normal, missing/invalid and failure-inducing inputs. Confirm declared outputs are populated, exit codes map to step status, permissions are sufficient but not excessive, and no secret values leak. Pin the caller to a commit SHA during verification and compare produced artifacts or target state independently.
Step 2 Common mistakes Narrow the fault
- Third-party actions referenced by tag instead of commit SHA.
Step 3 Where it fails Narrow the fault
Separate caller workflow syntax, revision resolution/download, runner environment, action runtime/dependencies, permissions/secrets, external APIs and final target state. “Action not found” differs from runtime failure, and a successful action step may still produce semantically wrong output. Do not switch to a mutable latest tag to fix a failure; verify the pinned implementation and target boundary first.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Pin to a full commit SHA.
- Review third-party actions.
- Prefer official actions.
grep -rn 'uses:' .github/workflows— actions used- Pin to full commit SHA — supply chain
- Dependabot for actions — updates
ReferenceWhy it matters1 section · depth on demand
In depth
Actions are reusable step packages — JavaScript, Docker or composite — referenced with uses: in a workflow, such as actions/checkout or actions/setup-python. They come from the Marketplace, other repositories or the same repository.
- uses: actions/setup-python@v5
with: { python-version: '3.12' }
- uses: org/internal-actions/render@3f2a1c9d... # pinned commit SHA
| Security practice | Reason |
|---|---|
| Pin to full commit SHA | Tags can be moved by the owner |
| Prefer verified/official actions | Lower supply-chain risk |
| Review what an action does with secrets | It runs with your token |
| Dependabot for action updates | Stay patched |
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
A GitHub Action is a reusable execution unit referenced by workflow steps. Metadata declares inputs, outputs and runtime implementation, while the action code or composite steps execute on the runner. JavaScript, Docker and composite actions have different packaging/runtime boundaries. The caller controls permissions, environment, secrets and revision pinning; the action controls its implementation contract. Mutable tags can change behavior without changing the workflow file.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle
Maintain the action repository like a versioned dependency: test releases, publish immutable tags/SHAs, update runtime dependencies and document breaking input/output changes. Keep default permissions minimal and avoid assuming secrets are always present. For JavaScript actions, bundle required code as prescribed by GitHub rather than depending on an undeclared install step. Deprecate old major versions explicitly.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in GitHub Actions > Actions. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.github.com/en/actions/concepts/workflows-and-actions/custom-actions · confidence 94%Quick lookup tables
GitHub Actions → Actions · operational reference
Context-specific ownership, verification, output and failure-boundary lookup for GitHub Actions → Actions.
| Layer | GitHub Actions → Actions operational reference |
|---|---|
| Runtime/ownership | GitHub Actions custom actions · identify controller/parser, durable intent, identity and target ownership before mutation |
| Persistent intent | Versioned definition/configuration with explicit dependencies, scope and credential boundary |
| Verification | Inspect action.yml/action.yaml, pin the action revision, run a fixture workflow, validate inputs/outputs/exit code and inspect runner logs plus downstream result. |
| Expected interpretation | The action metadata matches the implementation, declared inputs/outputs are deterministic, failures set the expected status, and the calling workflow pins a reviewed revision. |
| Recovery boundary | Preserve correlation IDs + pre-state, repair first failing boundary, then verify the target independently |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture workflow/run/job/step IDs, action repository and exact revision, runner OS, sanitized inputs, declared outputs, exit/status, log annotations and any external request/resource IDs. Distinguish the action’s step result from later job/workflow outcome. Preserve enough version identity to reproduce behavior after the action repository moves forward.