Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 13 additions & 1 deletion .github/actions/setup-pinned-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ mismatch, or a `SHASUMS256.txt` without the tarball's line.
node-version-file: .base/.node-version
```

A job with a sparse `.base` checkout lists `/.github/actions/setup-pinned-node/` in it. A composite
A job with a sparse `.base` checkout lists `/.github/actions/setup-pinned-node/` in it. A job whose
root checkout is the code under test, and which already runs that code, uses the root copy, so a
pull request that changes this action is tested by its own CI:

```yaml
- name: Set up Node
uses: ./.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .node-version
```

Never use the root form in a job that runs with main's trust and has a pull request checked out at
the root: there it would run pull request code. A composite
action in the same checkout runs `install-node.sh` from its sibling directory instead, as
`check-wip-cap` does. Tests: `scripts/setup-pinned-node.test.sh`.
3 changes: 1 addition & 2 deletions .github/workflows/eval-browser-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@ jobs:
persist-credentials: false

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.base/.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .base/.node-version
package-manager-cache: false

- name: Check the kill switch
id: kill
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maintenance-check-upstream-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .node-version
- name: Run the drift check
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pr-require-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ jobs:
# not enforce the policy does not pay for its toolchain either.
- name: Set up Node
if: needs.select-tests.outputs.run_workflows == 'true'
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .node-version
- name: Restore the npm cache
Expand Down Expand Up @@ -2055,7 +2055,7 @@ jobs:
# pay for it.
- name: Set up Node
if: needs.select-tests.outputs.run_tests == 'true'
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .node-version

Expand Down Expand Up @@ -2199,7 +2199,7 @@ jobs:
# claude CLI from node_modules/.bin, and node for the prerequisite gate.
- name: Set up Node
if: needs.select-tests.outputs.run_tests == 'true'
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .node-version
- name: Restore the npm cache
Expand Down Expand Up @@ -2701,7 +2701,7 @@ jobs:
# hosted and local runs exercise the same contract suites instead of
# inheriting different image tool inventories.
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .node-version
- name: Restore the npm cache
Expand Down Expand Up @@ -2969,7 +2969,7 @@ jobs:
with:
filter: blob:none
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .node-version
- name: Restore the npm cache
Expand Down Expand Up @@ -3096,7 +3096,7 @@ jobs:
# from, so a change to any one of them invalidates the cache the others
# share.
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .node-version
- name: Restore the npm cache
Expand Down Expand Up @@ -4122,6 +4122,7 @@ jobs:
persist-credentials: false
sparse-checkout: |
/.node-version
/.github/actions/setup-pinned-node/
/plugins/source-control/skills/babysit-prs/scripts/*.py
/plugins/source-control/lib/parse-concern-value.sh
/plugins/source-control/lib/yaml-subset.awk
Expand All @@ -4135,10 +4136,9 @@ jobs:
sparse-checkout-cone-mode: false
- name: Set up Node
if: ${{ !cancelled() && (github.event_name == 'pull_request' || github.event_name == 'merge_group') }}
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.base/.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .base/.node-version
package-manager-cache: false
# THE HOLD STEPS READ THEIR CONFIG FROM THE BASE COMMIT, ONCE. The tracker
# config names the human-gated label, the trusted-actor list names who
# may lift a hold and, with pr-pipeline.yaml's merge.agent-identity, the
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr-review-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
/.github/actions/check-trusted-trigger/
/.github/actions/log-api-budget/
/.github/actions/resolve-config/
/.github/actions/setup-pinned-node/
/.github/CODEOWNERS
/.github/standards/github-actions-conventions/vocabulary.json
/.node-version
Expand All @@ -88,10 +89,9 @@ jobs:
sparse-checkout-cone-mode: false

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.base/.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .base/.node-version
package-manager-cache: false

- name: Resolve the review model
id: models
Expand Down Expand Up @@ -132,14 +132,14 @@ jobs:
persist-credentials: false
sparse-checkout: |
/.github/actions/check-kill-switch/
/.github/actions/setup-pinned-node/
/.node-version
sparse-checkout-cone-mode: false

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.base/.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .base/.node-version
package-manager-cache: false

- name: Check the kill switch
id: kill
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/pr-review-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ jobs:
run: echo "$LANE-base-sha=$(git -C .base rev-parse --verify HEAD)" >>"$GITHUB_OUTPUT"

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.base/.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .base/.node-version
package-manager-cache: false

- name: Check the kill switch
id: kill
Expand Down Expand Up @@ -595,10 +594,9 @@ jobs:
run: echo "$LANE-base-sha=$(git -C .base rev-parse --verify HEAD)" >>"$GITHUB_OUTPUT"

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.base/.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .base/.node-version
package-manager-cache: false

- name: Check the kill switch
id: kill
Expand Down Expand Up @@ -1065,10 +1063,9 @@ jobs:
run: echo "$LANE-base-sha=$(git -C .base rev-parse --verify HEAD)" >>"$GITHUB_OUTPUT"

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.base/.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .base/.node-version
package-manager-cache: false

- name: Check the kill switch
id: kill
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr-review-security-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
/.github/actions/check-trusted-trigger/
/.github/actions/log-api-budget/
/.github/actions/resolve-config/
/.github/actions/setup-pinned-node/
/.github/CODEOWNERS
/.github/standards/github-actions-conventions/vocabulary.json
/.node-version
Expand All @@ -93,10 +94,9 @@ jobs:
sparse-checkout-cone-mode: false

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.base/.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .base/.node-version
package-manager-cache: false

- name: Resolve the review model
id: models
Expand Down Expand Up @@ -137,14 +137,14 @@ jobs:
persist-credentials: false
sparse-checkout: |
/.github/actions/check-kill-switch/
/.github/actions/setup-pinned-node/
/.node-version
sparse-checkout-cone-mode: false

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
uses: ./.base/.github/actions/setup-pinned-node # zizmor: ignore[self-repository]
with:
node-version-file: .base/.node-version
package-manager-cache: false

- name: Check the kill switch
id: kill
Expand Down
3 changes: 1 addition & 2 deletions scripts/ci-lanes-pr-hold.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,7 @@ fi
ci_status="$(awk '/^ ci-status:/ { on = 1; print; next } on && /^ [A-Za-z0-9_-]+:$/ { exit } on { print }' "$WORKFLOW")"
if grep -qE '^ +uses: actions/cache(/restore)?@' <<<"$ci_status"; then
fail "ci-status restores an Actions cache"
elif [[ "$(grep -A3 -E '^ +uses: actions/setup-node@' <<<"$ci_status")" == *'package-manager-cache: false'* ]] &&
[[ "$(grep -cE '^ +uses: actions/setup-node@' <<<"$ci_status")" -eq "$(grep -cE '^ +package-manager-cache: false$' <<<"$ci_status")" ]]; then
elif [[ "$(grep -cE '^ +uses: actions/setup-node@' <<<"$ci_status")" -eq "$(grep -cE '^ +package-manager-cache: false$' <<<"$ci_status")" ]]; then
ok "ci-status restores no Actions cache, setup-node's package cache included"
else
fail "ci-status's setup-node may restore a package cache (no package-manager-cache: false)"
Expand Down
Loading