CI action not pinned
CI action not pinned. A third-party action pinned to a moving tag (- uses: actions/checkout@v4).
This is how the comment reads inline, under the flagged line.
Why it matters
Tags can be moved to new code. A compromised action runs with your CI secrets.
What to do
Pin the full commit SHA and let a bot update it.
Examples
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
What it catches
It reads a pattern on each line, aware of strings and comments. Languages: Any file. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.
Flagged
.github/workflows/ci.yml
- uses: actions/checkout@v4
Left alone
.github/workflows/ci.yml
- uses: ./local-action
Research
CI actions referenced by tag or branch instead of a commit SHA. A moved tag runs new third-party code in CI.
Turn it off or change it
In a config file for the CLI, or in the API's rules field:
{
"rules": {
"disable": [
"unpinned-action"
],
"severity": {
"unpinned-action": "medium"
}
}
}