diff --git a/.cursor/rules/github-actions.mdc b/.cursor/rules/github-actions.mdc new file mode 100644 index 0000000..0557203 --- /dev/null +++ b/.cursor/rules/github-actions.mdc @@ -0,0 +1,72 @@ +--- +description: Pin GitHub Actions to Node 24-compatible commit SHAs (not version tags) +globs: .github/workflows/**/*.{yml,yaml} +alwaysApply: false +--- + +# GitHub Actions — Node 24 and SHA pinning + +When you **create or change** any file under `.github/workflows/` (or composite/reusable actions under `.github/actions/`): + +## 1. Use Node 24–compatible action majors + +GitHub deprecated Node 20 for JavaScript actions. Do **not** use older majors that still target Node 20: + +| Action | Do not use | Use instead | +|--------|------------|-------------| +| `actions/checkout` | v4 and below | **v6** | +| `actions/setup-node` | v4 and below | **v6** | +| `actions/setup-python` | v5 and below | **v6** | +| `actions/upload-artifact` | v4 and below | **v7** | +| `actions/download-artifact` | v4 and below | **v8** | +| `actions/cache` | v4 and below | **v5** | + +Apply the same rule to other official `actions/*` helpers: pick the current major whose `action.yml` declares `using: node24`. + +## 2. Pin every `uses:` to a commit SHA + +- **Never** leave floating refs: `@v6`, `@v4`, `@main`, branch names, or tags alone. +- **Always** use the 40-character commit SHA, with the human-readable version in a trailing comment. + +```yaml +# Bad +uses: actions/checkout@v6 + +# Good +uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 +``` + +Preferred SHAs for common official actions (update when bumping): + +```yaml +uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 +uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 +uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 +uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 +uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 +uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 +``` + +Resolve newer SHAs from the latest patch tag on the major line: + +```bash +gh api "repos/actions/checkout/git/ref/tags/v6.0.3" -q '.object.sha' +# If type is "tag", dereference: gh api "repos/actions/checkout/git/tags/SHA" -q '.object.sha' +``` + +Apply the same SHA-pinning rule to third-party actions (`uses: org/action@sha # vX.Y.Z`). + +## 3. Run actionlint before finishing + +```bash +actionlint .github/workflows/*.yml +``` + +Fix all errors and warnings; re-run until exit code 0. + +## 4. Completion checklist + +- [ ] Official actions use Node 24–compatible majors (v6/v7/v8/v5 as above) +- [ ] Every `uses:` references a full commit SHA (not a tag/branch) +- [ ] Version comments match the resolved release (e.g. `# v6.0.3`) +- [ ] `actionlint` passes on changed workflows diff --git a/.github/workflows/proxy_integration_tests.yml b/.github/workflows/proxy_integration_tests.yml index 60b9acb..9dac3a7 100644 --- a/.github/workflows/proxy_integration_tests.yml +++ b/.github/workflows/proxy_integration_tests.yml @@ -16,12 +16,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: "22" cache: npm diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2fcd234..2a71f70 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,7 +22,7 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: ${{ github.event_name == 'workflow_run' && 'main' || github.event_name == 'release' && github.ref || 'main' }} @@ -50,7 +50,7 @@ jobs: # the toolcache `npm` binary on GitHub-hosted runners, so `npm publish` stayed on 10.x and OIDC trusted publishing never ran. - name: Setup Node if: steps.gate.outputs.publish == 'true' - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 24 cache: npm diff --git a/.github/workflows/release-on-merge.yml b/.github/workflows/release-on-merge.yml index 7c06786..6487546 100644 --- a/.github/workflows/release-on-merge.yml +++ b/.github/workflows/release-on-merge.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout merge commit - uses: actions/checkout@v6 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: ${{ github.event.pull_request.merge_commit_sha }} diff --git a/package-lock.json b/package-lock.json index e8648dc..b111fc7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "node-fetch": "^3.0.0", "superagent": "^8.0.0 || ^9.0.0 || ^10.0.0", "typed-rest-client": "^2.0.0", - "undici": "^5.0.0 || ^6.0.0 || ^7.0.0", + "undici": "^8.0.2", "wretch": "^2.0.0 || ^3.0.0" }, "peerDependenciesMeta": { @@ -2920,9 +2920,9 @@ "license": "MIT" }, "node_modules/undici": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-8.5.0.tgz", - "integrity": "sha512-xamtWoB1EshgjpmlXd7GGm2VfdDtw1+rD8uhry8pSNW3If6S8E0m2T2+orSKeZXEn/aPJMviCpDBA65WJt8zhg==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-8.9.0.tgz", + "integrity": "sha512-aWZpUj7XoGonMClx4gdDRfgBjqeA+F473aDmROQQbM9n6PRfK/u1q/a0X4wMTgcHfT8H6fpbt98PFuDUwFg2YA==", "dev": true, "license": "MIT", "engines": {