Skip to content

GitHub Actions pinned by SHA in ci.yml and publish.yml, but not in sarif-example.yml and diffguard.yml #563

@EffortlessSteven

Description

@EffortlessSteven

Summary

Three of four workflow files use SHA-pinned actions, but two workflows still use @tag versions.

Details

The CI hardening work (CHANGELOG: "SHA pinning for third-party Actions") was applied inconsistently:

Workflow Status
.github/workflows/ci.yml ✅ SHA-pinned (actions/checkout@v4, dtolnay/rust-toolchain@stable, Swatinem/rust-cache@v2)
.github/workflows/publish.yml ✅ SHA-pinned
.github/workflows/diffguard.yml ❌ Uses @tag versions
.github/workflows/sarif-example.yml ❌ Uses @tag versions

diffguard.yml (lines 24, 29, 32, 56)

  • actions/checkout@v4
  • dtolnay/rust-toolchain@stable
  • Swatinem/rust-cache@v2
  • actions/upload-artifact@v4

sarif-example.yml (lines 92, 100, 107, 189, 203)

  • actions/checkout@v4 (line 92; also lines 273, 308 — both commented out)
  • dtolnay/rust-toolchain@stable (line 100)
  • Swatinem/rust-cache@v2 (line 107)
  • actions/upload-artifact@v4 (line 189)
  • actions/github-script@v7 (line 203)

Why this matters

Tag/shallow pins can be overwritten, enabling supply chain attacks. The CHANGELOG explicitly calls out "SHA pinning for third-party Actions" as a security hardening measure already shipped.

Recommendation

Update sarif-example.yml and diffguard.yml to use the same SHA-pinned versions as ci.yml and publish.yml. Use curl -sS https://api.github.com/repos/<owner>/<repo>/releases/latest | grep -E \&quot;tag_name|browser_download_url\&quot; to find current SHAs for each action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions