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
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Node.js 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
cache: npm
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
fetch-depth: 0
persist-credentials: false
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Node.js 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
cache: npm
Expand All @@ -138,7 +138,7 @@ jobs:
fi
echo "sha256=$(sha256sum "${tarballs[0]}" | awk '{ print $1 }')" >> "$GITHUB_OUTPUT"
- name: Upload the packed artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ci-npm-package
path: ci-artifacts/*.tgz
Expand All @@ -152,7 +152,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Download the packed artifact by name
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ci-npm-package
path: ci-artifacts
Expand All @@ -179,7 +179,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Node.js 22
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 22.23.4
cache: npm
Expand All @@ -202,7 +202,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Node.js 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
cache: npm
Expand All @@ -222,7 +222,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Node.js 26
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 26.12.1
cache: npm
Expand All @@ -249,7 +249,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Node.js 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
cache: npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/live-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Node.js 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
cache: npm
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
persist-credentials: false
ref: ${{ github.event.workflow_run.head_sha }}
- name: Set up Node.js 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
cache: npm
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
run: npm ci --ignore-scripts
- name: Download the exact Release Please result
if: steps.result.outputs.has-result == 'true'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: release-please-result-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}
path: ${{ runner.temp }}/release-please-result
Expand Down Expand Up @@ -432,7 +432,7 @@ jobs:
"repos/${GITHUB_REPOSITORY}/actions/runs/${SOURCE_RELEASE_RUN_ID}" \
> "$SOURCE_RUN_FILE"
- name: Download the exact Release Please result
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: release-please-result-${{ env.SOURCE_RELEASE_RUN_ID }}-${{ env.SOURCE_RELEASE_RUN_ATTEMPT }}
path: ${{ runner.temp }}/release-please-result
Expand Down Expand Up @@ -542,7 +542,7 @@ jobs:
);
EOF
- name: Set up Node.js 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
cache: npm
Expand Down Expand Up @@ -655,7 +655,7 @@ jobs:
set -euo pipefail
echo "name=npm-package-${{ steps.version.outputs.version }}-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_OUTPUT"
- name: Upload the verified release artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ steps.artifact-name.outputs.name }}
path: ${{ steps.pack.outputs.tarball }}
Expand Down Expand Up @@ -693,7 +693,7 @@ jobs:
persist-credentials: false
ref: ${{ needs.verify.outputs.release-commit }}
- name: Set up Node.js 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
cache: npm
Expand Down Expand Up @@ -753,15 +753,15 @@ jobs:
persist-credentials: false
ref: ${{ needs.verify.outputs.release-commit }}
- name: Set up Node.js 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
package-manager-cache: false
registry-url: https://registry.npmjs.org
- name: Use a Trusted Publishing-capable npm CLI
run: npm install --global npm@11.12.1
- name: Download the verified release artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ needs.verify.outputs.artifact-name }}
path: release-artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
exit 1
fi
- name: Set up Node.js 24
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1
cache: npm
Expand Down Expand Up @@ -1205,7 +1205,7 @@ jobs:
EOF
- name: Upload the exact Release Please result
if: steps.preflight.outputs.mode == 'release'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: release-please-result-${{ github.run_id }}-${{ github.run_attempt }}
path: release-please-result/result.json
Expand Down
11 changes: 11 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@ Responses streams. It never contacts the production API.
validate every workflow. It is not a GitHub Actions emulator and does not prove
that any workflow executed remotely.

Action updates that touch `publish.yml` require a coordinated review of the
upstream commits and the resulting executable workflow. After that review,
update `PUBLISH_WORKFLOW_CONTRACT_SHA256` in
`scripts/release-workflow-validation.mjs` in the same pull request as the action
pins, then run `npm run verify`. The fingerprint is the SHA-256 of
`JSON.stringify(parse(publishYaml))`, using the repository's `yaml` package.
Dependabot cannot perform this review or update the fingerprint. Repeated
rebases or reruns of an action-only pull request will therefore keep failing;
finish the coordinated update before merging it. Preserve the negative tests
for unreviewed action commits, permissions, gates, and publication commands.

## Version and dist-tag agreement

`package.json` is the sole candidate-version authority; validation must not
Expand Down
2 changes: 1 addition & 1 deletion scripts/release-workflow-validation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const RELEASE_WORKFLOW_STEP = "Run Release Please";
const PUBLISH_OPERATION = "release";
const NPM_TAG_POLICY_ID = 55718965;
const PUBLISH_WORKFLOW_CONTRACT_SHA256 =
"379ba8678416ff96d3bcf220a23e8602d2b55890164b2847331def10b4e99693";
"98910174abd3fc5a1d7e8c0cb64efb717960d54557e9799beea39a6228ef4bac";
const PUBLISH_HANDOFF_IF =
"vars.RELEASE_PLEASE_ENABLED == 'true' && github.event_name == 'workflow_run' && github.run_attempt == 1 && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main'";
const PUBLISH_RESULT_IF = "steps.result.outputs.has-result == 'true'";
Expand Down
15 changes: 15 additions & 0 deletions tests/release-workflow-validation.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,21 @@ describe("Publish workflow dispatch contract", () => {
});
});

it.each([
"actions/setup-node",
"actions/upload-artifact",
"actions/download-artifact",
])("rejects an unreviewed %s commit", (action) => {
const workflow = workflowContract();
const step = Object.values(workflow.jobs)
.flatMap((job) => job.steps)
.find((candidate) => candidate.uses?.startsWith(`${action}@`));
step.uses = `${action}@${"a".repeat(40)}`;
expect(() => validatePublishWorkflowContract(workflow)).toThrow(
/Publish executable definition digest/,
);
});

it.each([
[
"optional control input",
Expand Down
Loading