Skip to main content

Security for GitHub Actionss

Workflow security is hardening pipelines against abuse. Key measures include setting minimal permissions for GITHUB_TOKEN, pinning third-party actions to commit SHAs, avoiding script injection from untrusted input such as pull request titles, handling fork pull requests carefully, and scanning dependencies and code.

Stage: Security and Operations · Part of the GitHub Actions roadmap · Last reviewed 19 November 2026

What to learn in Security

Security interview questions

How can script injection happen in a workflow?

If a run step interpolates untrusted data like a pull request title directly with the expression syntax, an attacker can craft text that breaks out and runs commands. Pass the value through an environment variable and reference that in the shell instead.

Why pin actions to a commit SHA?

Tags and branches can be moved or compromised, so a workflow using a tag could suddenly run malicious code. A full commit SHA is immutable, guaranteeing that the exact reviewed code runs, and Dependabot can update the pin.

Where Security fits in the GitHub Actions roadmap

Security belongs to the Security and Operations stage (intermediate level). Keep it safe.

Back to the full GitHub Actions roadmap