Skip to content
Français
CI/CD & Automatisation medium

GitHub Actions: securing your CI/CD

2 min de lecture

Read this page in French

GitHub Actions runs your code with elevated privileges: access to your secrets, write rights on the repository, the ability to publish packages. This section explains how the platform works, what it costs, and above all how to secure it, from the GITHUB_TOKEN permissions to provenance attestations. The English pages focus on security, the part that is most often treated last and where the real incidents happen.

What is GitHub Actions?

GitHub Actions is the CI/CD (continuous integration and continuous delivery) automation platform built natively into GitHub. Launched in 2019, it runs code automatically in response to events on your repository.

Concretely, GitHub Actions lets you:

  • Automate the tests: on every push or pull request, your tests run by themselves
  • Build and publish: compile your code, create Docker images, publish to npm or PyPI
  • Deploy: push automatically to AWS, Azure, GCP, Kubernetes, or your own infrastructure
  • Maintain your code: check the formatting, analyse the security, update the dependencies
  • Orchestrate tasks: schedule recurring actions, react to issues or releases

How does it work?

Everything rests on workflows: YAML files placed in the .github/workflows/ directory of your repository. Each workflow defines:

  1. When to run (push, pull request, schedule, manually, and so on)
  2. What to do (a series of tasks called jobs and steps)
  3. Where to do it (on virtual machines called runners)
# A minimal workflow example
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: npm test

When you push code, GitHub detects the workflows automatically, provisions a virtual machine, runs your tasks, and shows the results in the interface.

The Marketplace: an ecosystem of actions

One of the strengths of GitHub Actions is its Marketplace: thousands of ready-made actions built by the community and by vendors. Rather than rewriting the logic to "deploy to AWS" or "send a Slack notification", you use an existing action.

But be careful: using an action means running third-party code with access to your secrets. The security of your pipeline depends on the trust you place in those actions. That is why this section insists on SHA pinning and on verifying the sources.

What does it cost?

GitHub Actions is free in two situations that cover a large share of real usage: public repositories on standard runners, and self-hosted runners, whatever the visibility of the repository. Everything else draws on a monthly included quota, then bills per minute.

PlanIncluded minutes per month
GitHub Free2,000
GitHub Pro3,000
GitHub Team3,000
GitHub Enterprise Cloud50,000

Beyond the quota: a price per machine

The old multiplier model (a Windows minute counted twice, a macOS minute counted ten times) has disappeared from the GitHub documentation, replaced by a per-SKU price list. Each runner type now carries its own per-minute rate:

Standard runnerPrice per minute
Linux 2-core (x64)$0.006
Linux 2-core (arm64)$0.005
Windows 2-core (x64)$0.010
macOS 3 or 4-core$0.062

The order of magnitude has not changed, a macOS minute still costs roughly ten times a Linux minute. What changed is the reading: the price is read directly, and the same list covers the larger runners (4 cores and above) and the GPU runners, billed significantly more.

The escape hatch: self-hosted runners

Self-hosted runners (machines you manage yourself) consume no minute of the GitHub quota, and using Actions on them is free. It is the economical option for large volumes or specific needs (GPU, internal network). The trade-off is not financial but security-related: you inherit the isolation, the hardening and the lifecycle of those machines.

Following your consumption

Go to Settings, then Billing and plans, then Plans and usage to see your current consumption. You can also configure alerts to avoid surprises.

For open source projects, everything is free and unlimited. That is one of the reasons GitHub Actions became the de facto standard for open source CI/CD.

Why security comes first here

The 2025-2026 incidents make the case better than any argument. The tj-actions/changed-files compromise leaked the secrets of nearly 23,000 repositories into public build logs. GhostAction stole 3,325 secrets across 817 repositories. Shai Hulud v2 spread through 796 npm packages. And in February 2026, an autonomous AI bot wiped the Trivy repository after exploiting a vulnerable workflow.

None of those attacks needed a zero-day. They walked through five doors you control: a badly secured pull_request_target, mutable tags, excessive permissions, command injection, and uncontrolled network exfiltration.

Where to start

Understand the attacks

What actually happened in 2025 and 2026

tj-actions, GhostAction, Shai Hulud v2, hackerbot-claw: the four real cases, the five vectors they used, and the fix for each one.

Read the analysis

Harden your workflows

Permissions, pinning, triggers, OIDC

The concrete configuration: permissions: {}, actions pinned by SHA, pull_request_target neutralised, cloud credentials replaced by OIDC.

Start with the permissions

Scan automatically

actionlint, zizmor, poutine, Plumber

Four complementary tools: syntax, workflow security, multi-platform pipelines, and an A-E posture score.

Compare the scanners

Prove what you ship

Provenance, SBOM, verification

Generate a SLSA attestation for every release, then verify it before deployment, in CI/CD and at admission time in Kubernetes.

Generate the attestations

FAQ: frequent questions

These questions come back constantly, from the first workflow to the first security audit.

Next steps

Is this site useful to you?

Fewer than 1% of readers support this site.

I maintain more than 700 free guides, with no ads and no tracking. Any support, even a symbolic one, helps cover hosting and keeps these resources free. Thank you for the help.

The form does not show? Open Ko-fi in a new tab.

Subscribe and follow my DevSecOps work on LinkedIn