Skip to content

Commit 2d072b6

Browse files
ShiosOSclaude
andauthored
Harden CI workflow (least-privilege, SHA-pinned actions, concurrency) (#5)
- Add a least-privilege `permissions: contents: read` block. - Pin actions to commit SHAs and move to v6 (runs on the Node 24 action runtime, clearing the Node 20 deprecation warning). - Cancel superseded runs for the same ref via concurrency. - Add .nvmrc (24) and a package.json engines floor (>=22). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4fb4969 commit 2d072b6

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,25 @@ on:
55
branches: [main]
66
pull_request:
77

8+
# Least privilege: this workflow only needs to read the repo.
9+
permissions:
10+
contents: read
11+
12+
# Cancel superseded runs for the same ref to save CI minutes.
13+
concurrency:
14+
group: ci-${{ github.ref }}
15+
cancel-in-progress: true
16+
817
jobs:
918
check:
1019
runs-on: ubuntu-latest
1120
steps:
12-
- uses: actions/checkout@v4
21+
# Actions are pinned to commit SHAs (supply-chain hardening); the
22+
# trailing comment records the human-readable version. v6 runs on the
23+
# Node 24 action runtime, clearing the Node 20 deprecation warning.
24+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1325

14-
- uses: actions/setup-node@v4
26+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
1527
with:
1628
node-version: 24
1729
cache: npm

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "1.1.0",
44
"description": "Dev tooling for the GitHub PR Reverse Comments browser extension. The extension itself has no build step; these scripts only lint, format, test, and package it.",
55
"private": true,
6+
"engines": {
7+
"node": ">=22"
8+
},
69
"scripts": {
710
"lint": "eslint .",
811
"format": "prettier --write .",

0 commit comments

Comments
 (0)