Safeguard
Supply Chain•

How do you review a project's GitHub Actions before adopting it?

Read a candidate dependency's workflow files for four risks: untrusted input, token permissions, unpinned actions and privileged triggers. A checklist.

Safeguard Security Team
4 min read

To review a project's GitHub Actions before adopting it, open the .github/workflows folder and check four things: whether untrusted text flows into shell commands, whether the token is limited to read-only, whether third-party actions are pinned to a full commit SHA, and whether privileged triggers check out pull request code.

Why the workflow matters to you

Your dependency's release is made by its CI. If an attacker can run code in that CI, they can alter what gets published, and you install it. OpenSSF Scorecard treats this seriously: its Dangerous-Workflow check carries the highest weight in the aggregate. Reading the files yourself takes ten minutes.

The four checks

1. Script injection

GitHub's hardening guide warns against interpolating untrusted values, such as a pull request title, directly into an inline script. The safe pattern is to pass the value through an env: entry and reference the environment variable in the shell. Search the files for github.event inside a run: block.

2. Token permissions

GitHub recommends setting the default token permission to read-only and raising it only for jobs that need more. Look for a permissions: block near the top of each workflow. A missing block is not proof of a problem, since the repository default may be restrictive, but it is a question to ask.

3. Pinned actions

GitHub advises pinning each third-party action to a full-length commit SHA, because a tag can be moved or deleted. Seeing uses: owner/action@v3 is common and less strict. It tells you how much the maintainers worry about a compromised action.

4. Privileged triggers

GitHub tells authors not to use pull_request_target unless they need its privileged context, and not to check out untrusted pull request code in workflows that use it. workflow_run is the recommended alternative for privilege separation.

A quick table

Look forGood signQuestion to ask
run: with event dataValues passed through envIs any title, branch or body used inline?
permissions:Read-only defaultWhich job gets write access, and why?
uses:Full SHAIs a tag trusted without review?
pull_request_targetAbsent, or no checkout of PR codeDoes it run fork code with secrets?
npm publishTrusted publishing or provenanceDoes a long-lived token publish?

Trusted publishing on npm uses short-lived OpenID Connect credentials tied to a workflow instead of long-lived tokens, which removes the risk of a leaked write token. If you see it, note it as a plus. Our post on the AsyncAPI pipeline hijack shows why you still keep reviewing.

What a bad result means

You do not have to reject the project. You can choose to vendor, pin, or ask the maintainer to fix it. Many maintainers welcome a polite issue, and private vulnerability reporting is available where enabled.

Safeguard can help here. Its SBOM and dependency scanning, reachability analysis and policy gates cover the checks that should repeat after adoption, and the free scan at gold.safeguard.sh/scan shows what a project already depends on.

Quick check

Do I need to be a CI expert to do this?

No. Searching for four patterns is enough for a first pass. Escalate to a security engineer if you find privileged triggers with untrusted checkout.

Does a clean workflow mean a safe release?

It lowers one class of risk. Account takeover and malicious maintainers are separate problems.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.