Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,20 @@ jobs:
api-docs-drift:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "2G"
CARGO_INCREMENTAL: "0"
steps:
- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Start sccache
uses: mozilla-actions/sccache-action@v0.0.10
Comment on lines +124 to +125

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check latest release of mozilla-actions/sccache-action
gh api repos/mozilla-actions/sccache-action/releases/latest --jq '.tag_name'

# Get the commit SHA for v0.0.10 to pin it
gh api repos/mozilla-actions/sccache-action/git/ref/tags/v0.0.10 --jq '.object.sha'

Repository: PerryTS/perry

Length of output: 106


Pin the sccache action to a commit hash for supply-chain security.

Replace mozilla-actions/sccache-action@v0.0.10 with the commit SHA: mozilla-actions/sccache-action@1583d6b38d7be47f593cb472781bbb21cab4321e (v0.0.10 is the latest version). Using a commit hash prevents supply-chain risks if the tag is moved or compromised.

🧰 Tools
🪛 zizmor (1.25.2)

[error] 125-125: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 125-125: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): always restores from cache

(cache-poisoning)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test.yml around lines 124 - 125, In the test.yml workflow
file, replace the sccache action reference from using the version tag (v0.0.10)
to using the full commit hash for supply-chain security. Change
`mozilla-actions/sccache-action@v0.0.10` to
`mozilla-actions/sccache-action@1583d6b38d7be47f593cb472781bbb21cab4321e` in the
"Start sccache" step to pin the action to a specific commit rather than a
potentially mutable tag.

Source: Linters/SAST tools


- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-perry"
Expand Down Expand Up @@ -167,12 +175,36 @@ jobs:
# don't exercise any platform behavior; they're pure logic +
# codegen.
runs-on: ubuntu-latest
# Was unbounded (the workflow default of 360 min). This gate legitimately
# runs ~45-50 min (per-package serial build+prune loop below, plus the big
# stdlib links), and a cold sccache run can be a bit slower — so the bound
# is set well ABOVE the real runtime: it exists only to cut a true hang
# (e.g. a flaky link SIGBUS retry storm) at ~2 h instead of 6 h, never to
# fail a normal slow run.
timeout-minutes: 120
# sccache (compiler-level cache, shared across ALL branches/jobs via the
# GitHub Actions cache backend) on top of Swatinem/rust-cache (target/ +
# registry). rust-cache only writes on main (save-if below), so PRs can't
# warm it — and any change to the constantly-churning perry-runtime
# invalidates the whole downstream target/, whereas sccache still reuses
# the unchanged compilation units. CARGO_INCREMENTAL=0 is required: sccache
# cannot cache incremental builds. SCCACHE_CACHE_SIZE bounds the on-runner
# cache so it doesn't compound this job's known disk pressure (the prune
# loop below).
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "2G"
CARGO_INCREMENTAL: "0"
steps:
- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Start sccache
uses: mozilla-actions/sccache-action@v0.0.10

- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-perry"
Expand Down Expand Up @@ -314,12 +346,20 @@ jobs:
compiler-output-regression:
runs-on: ubuntu-latest
timeout-minutes: 45
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "2G"
CARGO_INCREMENTAL: "0"
steps:
- uses: actions/checkout@v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Start sccache
uses: mozilla-actions/sccache-action@v0.0.10

- uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-perry"
Expand Down