Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

GitHub Actions

Direct answer

GitHub Actions is GitHub's built-in CI/CD and automation service. Workflows in .github/workflows run jobs of steps on GitHub-hosted or self-hosted runners when events such as push or pull_request happen.

When to use this

Use this when building CI/CD and automation with GitHub Actions workflows.

First 30 seconds

1. GitHub Actions: workflows in .github/workflows triggered by events.

2. Pin actions to commit SHAs.

3. Least-privilege GITHUB_TOKEN permissions.

4. OIDC for cloud.

5. Protect environments.

Operational verification

event → workflow → jobs on runners → steps

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
GitHub Actions current
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformGitHub Actions current · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when building CI/CD and automation with GitHub Actions workflows.
What next?3 suggested next steps
Child topics (this level)16
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Target-state verification ladder Verify boundary

GitHub Actions uses a strict target-state ladder for workflow job/runner action: request accepted → job/task succeeded → target object changed → effective runtime state confirmed → original workload verified.

Step 2 Verification path Verify boundary

For a workflow under investigation, identify the exact run ID, event, ref/head SHA and workflow file revision. Inspect job expansion, runner assignment, permissions and step conclusions rather than relying on the repository-level badge. Reproduce a safe run with controlled inputs and verify expected skipped/conditional paths. For deployment workflows, correlate the run to a deployment/environment record and independently query the target service/version after completion. Test at least one denied-permission or invalid-input case so security and failure reporting are understood. For reusable workflows, verify caller inputs and callee revision. A green Actions run shows that its configured steps concluded successfully; it does not by itself show application health or that the desired artifact is serving traffic.

Step 3 Where it fails Narrow the fault

Separate event/trigger evaluation, workflow parsing, permissions/context resolution, job scheduling, runner execution, third-party action behavior and external target outcome. A workflow may not run because filters excluded it, a job may wait for a runner, a step may fail because an action dependency changed, or deployment may fail after all local build steps passed. Self-hosted runner failure is not repository logic failure. Do not rerun blindly until you know whether the previous attempt mutated an external target. Pinpoint the earliest missing expected state using run/job/step IDs, then inspect the adjacent layer. If a deployment action reports success but verification fails, preserve both records and diagnose the external target separately. Re-run the original workflow/consumer check after remediation.

Evidence references

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.

observation · 1
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic Workflow

A GitHub Actions workflow is a YAML file in .github/workflows that defines triggers, jobs and steps, such as building, testing and deploying code on every push.

Subtopic Events

Events trigger GitHub Actions workflows, defined under on:, such as push, pull_request, schedule, workflow_dispatch for manual runs, release or repository_dispatch from external systems.

Subtopic Jobs

Jobs in a GitHub Actions workflow run on separate runners, in parallel by default or in order with needs:, and each job is a sequence of steps sharing one workspace.

Subtopic Steps

Steps are the individual commands or actions in a job, run in order with run: for shell commands or uses: for actions, sharing the workspace and environment.

Subtopic Actions

Actions are reusable steps in GitHub Actions workflows, referenced with uses: such as actions/checkout@v4.

Subtopic Runners

Runners are the machines that execute GitHub Actions jobs, either GitHub-hosted or self-hosted, selected with runs-on labels.

Subtopic GitHub-hosted Runner

GitHub-hosted runners are fresh VMs (Ubuntu, Windows, macOS) that GitHub provides for each job, selected with runs-on: ubuntu-latest, with common tools preinstalled and no maintenance.

Subtopic Self-hosted Runner

Self-hosted runners are your own machines running the GitHub Actions runner agent, used for special hardware, private network access or cost.

Subtopic Variables

Variables in GitHub Actions are non-secret configuration values set at repository, environment or organization level and read with ${{ vars.NAME }}, plus env: values within workflows.

Subtopic Secrets

Secrets in GitHub Actions are encrypted values stored at repository, environment or organization level and read as ${{ secrets.NAME }}.

Subtopic Environments

Environments in GitHub Actions group deployment targets like staging and production with their own secrets, required reviewers, wait timers and branch restrictions.

Subtopic Matrix Strategy

A matrix strategy runs one job across combinations of variables, such as several OS and language versions, using strategy.matrix, with fail-fast and max-parallel controls.

Subtopic Artifacts

Artifacts in GitHub Actions are files saved from a job with actions/upload-artifact and downloaded in later jobs or from the run page, such as build outputs or test reports, with a retention period.

Subtopic Caching

Caching in GitHub Actions stores dependencies like npm, pip or Maven files between runs with actions/cache or setup-* cache options, keyed by lock-file hashes to speed up builds.

Subtopic Reusable Workflows

Reusable workflows are called from other workflows with uses: owner/repo/.github/workflows/file.yml@ref and workflow_call inputs and secrets, sharing standard pipelines across repositories.

Subtopic GitHub Actions Troubleshooting

Troubleshoot GitHub Actions by reading the step logs, enabling debug logging (ACTIONS_STEP_DEBUG), checking the trigger and path filters, permissions of GITHUB_TOKEN, secrets availability on forks and runner labels.

Key points
  • Pin third-party actions to a commit SHA.
  • Grant GITHUB_TOKEN least privilege.
  • Secrets are not passed to forked pull requests.
Key checks
  • gh workflow list — workflows
  • gh run list --limit 10 — recent runs
  • actionlint — lint workflow files
ReferenceWhy it matters1 section · depth on demand

In depth

GitHub Actions is GitHub's built-in CI/CD: YAML workflows in .github/workflows/ run jobs on GitHub-hosted or self-hosted runners in response to repository events.

name: ci
on: [pull_request]
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: pip install ansible-lint && ansible-lint
FeatureUse
Marketplace actionsReusable steps
EnvironmentsApprovals and environment secrets
OIDCCloud access without stored keys
Reusable workflowsShared pipelines across repos

Pin third-party actions to a commit SHA and set minimal permissions: for the GITHUB_TOKEN.

ReferenceImportant terms & boundaries1 section · depth on demand

Mechanics

GitHub Actions executes repository-defined workflows when configured events, manual dispatches, schedules or reusable-workflow calls create workflow runs. A workflow run contains jobs; jobs are scheduled onto GitHub-hosted or self-hosted runners and contain ordered steps/actions. Contexts, expressions, secrets, environment protection and GITHUB_TOKEN permissions are evaluated at different scopes, so the same YAML can behave differently by event type, ref or environment. Matrix expansion creates multiple job instances, while needs forms job dependencies. Actions themselves may be JavaScript, container or composite implementations and are supply-chain dependencies. The workflow run conclusion is therefore the result of a controller/runner pipeline, not direct evidence of an external deployment or service state.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Lifecycle

Keep workflow YAML under review in .github/workflows, pin third-party actions to trusted versions or immutable commits according to risk, and minimize GITHUB_TOKEN/secret permissions at workflow and job scope. Treat runner images and self-hosted runner configuration as execution dependencies; self-hosted runners require patching, isolation and cleanup ownership. Use environments for deployment policy/approval where appropriate and separate build/test credentials from production deployment credentials. Reusable workflows should expose explicit inputs/secrets and versioning so callers do not depend on hidden repository state. Changes to triggers, permissions, action versions, runner labels or branch protection can materially change behavior and should be tested on non-production targets. Retain run IDs and artifacts long enough for release traceability.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docGitHub Actions current current

Authoritative/upstream documentation reviewed for bounded claims in > GitHub Actions. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.github.com/en/actions/get-started/understand-github-actions · confidence 94%
Embedded reference data

Quick lookup tables

→ GitHub Actions · operational reference

Context-specific ownership, verification, output and failure-boundary lookup for → GitHub Actions.

LayerGitHub Actions operational reference
Runtime/ownershipGitHub Actions current · identify controller/worker/target ownership before mutation
Persistent intentVersioned configuration/playbook/workflow with explicit dependencies and least-privilege identity
Verificationgh run list --limit 10; gh run view <run-id> --json status,conclusion,event,headSha,jobs
Expected interpretationThe workflow trigger, revision, permissions, runner environment, jobs and final conclusion are tied to one run ID, and deployment state is verified outside the workflow status.
Recovery boundaryPreserve correlation IDs + pre-state, then verify target/service independently after remediation
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Preserve run ID, workflow name/path, event, actor, head SHA/ref, attempt number, job IDs, runner names/labels, step conclusions and deployment/environment identifiers. Console logs are useful but can be truncated or redacted; structured run/job metadata is a more stable index. Distinguish status (queued/in_progress/completed) from conclusion (success/failure/cancelled/skipped/etc.). Matrix jobs need their dimension values retained so one failing variant is identifiable. Artifacts and test reports should be linked to the producing job/revision. Secret masking is not a substitute for avoiding secret output. For deployment, include an external target version/read-back so “workflow success” and “service success” are not collapsed into one field.

Confirmation

Confirm action

Continue?