Skip to content

GitHub Actions

GitHub Actions is GitHub's CI/CD and workflow automation platform: YAML workflows triggered by repository events, executed on hosted or self-hosted runners.

Definition

What it is

GitHub Actions is the CI/CD service built into GitHub. A repository contains one or more YAML files under .github/workflows/; each file declares a workflow, a workflow declares one or more jobs, and each job runs a sequence of steps on a runner. A step is either a shell command or a reference to a reusable action, which is a packaged unit of automation published to the GitHub Marketplace or to any repository.

The trigger model is the distinguishing feature. A workflow runs in response to an event: a push, a pull request, an issue, a release, a schedule, a manual dispatch, or an event from another workflow. That coupling between repository activity and automation is what separates Actions from standalone CI services such as CircleCI or Travis CI: the CI system does not need to poll GitHub for changes because GitHub is the event source.

The execution model is jobs-on-runners. A runner is a virtual machine or container that GitHub provisions on demand, or one that the customer hosts. GitHub-hosted runners ship with a preinstalled toolchain for common languages and run on Ubuntu, Windows or macOS. Self-hosted runners are machines that the customer registers with GitHub and controls directly.

Why it matters

Before GitHub Actions reached general availability in November 2019, CI/CD on GitHub required a third-party service. A repository pushed code to GitHub; GitHub notified the CI service via a webhook; the CI service pulled the repository, ran the build, and reported the result back through the commit status API. Every step was a boundary that could fail, and every boundary was a credential that had to be managed.

Actions collapsed those boundaries into one platform. The repository, the workflow definition, the runner, the secrets, the artifacts and the logs live in the same product. The practical consequence is shorter time-to-first-pipeline: a new repository can have a working CI workflow in ten lines of YAML and a commit, without provisioning an account elsewhere.

The economic consequence is more subtle. GitHub's pricing makes Actions free and unlimited on public repositories, and metered on private ones. The free tier for private repositories is 2,000 minutes per month on the Free plan, 3,000 on Pro and Team, and 50,000 on Enterprise. Usage beyond the quota is billed per minute, with macOS runners costing 10x and Windows runners 2x the Linux rate. For open-source projects, the practical effect is that a mature CI pipeline is essentially free.

How it works

The lifecycle of a workflow run has five stages:

  1. Trigger. An event fires (push, pull request, schedule, manual dispatch).
  2. Match. GitHub reads the workflow files and selects those whose on: clause matches the event and whose branch or path filters match the change.
  3. Provision. GitHub allocates a runner for each job. Hosted runners are ephemeral: a fresh VM or container per job, destroyed afterwards. Self-hosted runners are persistent unless configured otherwise.
  4. Execute. The runner checks out the repository, sets up the environment, and runs the steps in order. Steps share a workspace but not a process; environment variables set in one step do not persist to the next unless written to $GITHUB_ENV.
  5. Report. The runner sends logs, artifacts and the job result back to GitHub. The commit status is updated, and downstream jobs that depend on this job may proceed or be cancelled.

Several features extend this core. Matrix builds run the same job across a combination of values (three Node.js versions × three operating systems = nine jobs) in parallel. Caching stores dependency directories between runs, keyed by a hash of the lockfile. Artifacts persist files after a job ends, for download or for a later job. Reusable workflows let one workflow call another, which is how organisations factor out shared pipelines. OIDC lets a workflow authenticate to a cloud provider without a long-lived secret: GitHub issues a short-lived JWT, and the cloud provider exchanges it for a scoped access token.

Common failures

The first failure is unpinned actions. An action referenced by a mutable tag can change under the workflow without warning. A tag is convenient; a SHA is reproducible. The trade-off is maintenance overhead versus supply-chain risk, and the correct answer depends on the threat model.

The second failure is secret leakage. A step that prints env to the log will print every environment variable, including any that were injected as secrets. GitHub masks known secret values in logs, but the masking is best-effort: a secret transformed by base64 or split across lines escapes it.

The third failure is over-permission. Before 2023, the default GITHUB_TOKEN had write access to many scopes. The default is now read-only, but workflows written before the change may still assume write access and fail silently. Explicit permissions: blocks are the fix.

The fourth failure is cost surprise. macOS runners consume minutes at 10x the Linux rate. A test matrix that runs on Ubuntu, Windows and macOS can consume a private repository's monthly quota in a single afternoon.

Origin

GitHub Actions was announced at GitHub Universe in October 2018 as a workflow automation tool: run code in response to events on GitHub. The initial version let developers trigger arbitrary containers from repository events, but it was not a full CI/CD service. Developers used it for CI anyway, and the feedback was consistent: make it a first-class CI/CD platform.

On 8 August 2019 GitHub launched the beta of a new version of Actions with full CI/CD capabilities, including matrix builds, multi-OS runners and a marketplace of reusable actions. General availability followed on 13 November 2019 at GitHub Universe. At GA, the Marketplace listed more than 1,200 community-developed actions; GitHub had more than 40 million developers on the platform.

The service was owned by GitHub, which Microsoft acquired in 2018 for USD 7.5 billion. That ownership matters for the licence: GitHub Actions is a proprietary SaaS, not an open-source project. The workflow files are YAML, the runner software is partly open source (the actions/runner repository is MIT-licensed), but the service itself is a commercial product with metered pricing.

Since we introduced GitHub Actions last year, the response has been phenomenal, and developers have created thousands of inspired workflows. But we've also heard clear feedback from almost everyone: you want CI/CD!

— Nat Friedman, CEO of GitHub, 8 August 2019

Evidence

FAQ

Is GitHub Actions free?

On public repositories, yes: unlimited minutes and storage on standard GitHub-hosted runners. On private repositories, each plan has a monthly quota: 2,000 minutes on Free, 3,000 on Pro and Team, 50,000 on Enterprise. Beyond the quota, usage is billed per minute, with macOS at 10x and Windows at 2x the Linux rate.

How does it compare to GitLab CI or CircleCI?

GitLab CI is built into GitLab and uses a similar YAML model; CircleCI is a standalone service with a stronger focus on caching and parallelism. Actions wins when the repository already lives on GitHub; the integration cost of a separate CI service is the friction it removes.

Do I need self-hosted runners?

Only if the hosted runners do not fit the workload: specialised hardware (GPUs, ARM), network access to private resources, or cost control at very high volume. Hosted runners are simpler, ephemeral and maintained by GitHub; self-hosted runners are more flexible and more work.

How do I keep secrets safe?

Never echo them; GitHub masks known values in logs, but masking is not a security boundary. Use environment-scoped secrets, require reviewers for production environments, and prefer OIDC over long-lived cloud credentials. Pin actions to commit SHAs for the ones that touch secrets.

What is OIDC and why does it matter?

OpenID Connect lets a workflow prove its identity to a cloud provider (AWS, GCP, Azure) by presenting a short-lived JWT that GitHub issues. The cloud provider validates the JWT and returns a scoped access token. No long-lived cloud secret is stored in GitHub, so there is nothing to leak.

Pros and cons

Pros

  • Native integration with the repository: no webhook, no second account, no cross-service authentication.
  • Free and unlimited on public repositories; generous free tiers on private ones.
  • Marketplace with roughly 19,000 custom actions (July 2024) and thousands more published since.
  • Matrix builds, caching, artifacts, reusable workflows and OIDC in the free tier.
  • Self-hosted runners for specialised hardware or private-network workloads.

Cons

  • Vendor lock-in: workflows are GitHub-specific YAML and do not port to other CI systems without a rewrite.
  • Marketplace quality is uneven: most actions are unverified, a fifth have vulnerable dependencies, and hundreds are archived.
  • macOS and Windows runners burn minutes at 10x and 2x the Linux rate, which surprises teams late in the month.
  • Hosted runners are ephemeral and unprivileged, which limits Docker-in-Docker, nested virtualisation and long-running services.

Key numbers

Oct 2018GitHub announces Actions at Universe
8 Aug 2019beta of the full CI/CD version
13 Nov 2019general availability at GitHub Universe
1,200+community actions at GA
40M+developers on GitHub at GA
2,000free minutes/month on private repos (Free plan)
19,113custom actions analysed in the July 2024 security study
10xmacOS minute multiplier over Linux

Timeline

  1. October 2018 — GitHub announces Actions at Universe; workflow automation on repository events.

  2. 8 August 2019 — beta of the full CI/CD version with matrix builds and multi-OS runners.

  3. 13 November 2019 — general availability at GitHub Universe; 1,200+ community actions.

  4. 2020 — GitHub Packages and Container Registry reach general availability.

  5. 2021 — reusable workflows and the GITHUB_TOKEN permissions model are introduced.

  6. 2022 — OIDC for cloud authentication becomes widely adopted.

  7. 2023 — default GITHUB_TOKEN becomes read-only; supply-chain security becomes a mainstream concern.

  8. 2024 — 19,113 custom actions in the Marketplace, per an independent security study.

Entities

Products and organisations in the GitHub Actions story

nombretiporolurlestado
GitHub ActionsproductoCI/CD de GitHubhttps://github.com/features/actionsactivo
GitHubempresadueño del productohttps://github.comactivo
Microsoftempresadueño de GitHub desde 2018https://microsoft.comactivo
GitHub Marketplaceplataformacatálogo de acciones y appshttps://github.com/marketplaceactivo
actions/runnerproyectorunner open source (MIT)https://github.com/actions/runneractivo
actions/checkoutacciónacción oficial más usadahttps://github.com/actions/checkoutactivo
GitLab CIproductocompetidor integrado en GitLabhttps://about.gitlab.com/stages-devops-lifecycle/continuous-integration/activo
CircleCIproductocompetidor standalonehttps://circleci.comactivo

Learning path

Progression from beginner to expert

  1. Prerequisite

    continuous-integration, continuous-delivery, git, yaml

  2. This term

    You are here: github-actions.

  3. Next

    reusable-workflow, self-hosted-runner, oidc, supply-chain-attack, sbom

Connections

Sources

Etymology

Origin: compound

  • GitHub (noun): nombre propio de la plataforma; portmanteau de git + hub
  • Actions (noun): del latín actio, "hacer, ejecutar"; en el producto, unidades de automatización

Semantic network

GitHub ActioContinuousContinuousgitlab-cicirclecijenkinsoidcself-hoste

● broader ● narrower ● related

Broader

Related

  • gitlab-ci
  • circleci
  • jenkins
  • oidc
  • self-hosted-runner

Used in the garden

Sources