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
6 changes: 4 additions & 2 deletions .github/workflows/release-finalize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
resolve:
if: >-
github.repository == 'operatorstack/yield' &&
(github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success')
(github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'workflow_dispatch'))
runs-on: ubuntu-latest
outputs:
finalize: ${{ steps.release.outputs.finalize }}
Expand Down Expand Up @@ -86,7 +88,7 @@ jobs:
set -euo pipefail
version="${TAG#v}"
run="$(gh api "/repos/${GITHUB_REPOSITORY}/actions/workflows/npm-publish.yml/runs?head_sha=${SOURCE_SHA}&status=completed&per_page=30" \
--jq '[.workflow_runs[] | select(.event == "workflow_run" or .event == "workflow_dispatch")][0] // {}')"
--jq '[.workflow_runs[] | select(.event == "workflow_dispatch")][0] // {}')"
test "$(jq -r '.conclusion // "missing"' <<< "$run")" = success
run_id="$(jq -r '.id // empty' <<< "$run")"
test -n "$run_id"
Expand Down
2 changes: 2 additions & 0 deletions scripts/check-release-control.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ export async function checkReleaseControl(root = resolve(import.meta.dirname, ".
"receipt-complete finalization needs artifact read access and contents:write",
);
expect(finalizer.jobs?.finalize?.needs === "resolve", "finalization must follow read-only tag resolution");
expect(raw["release-finalize.yml"].includes("github.event.workflow_run.event == 'workflow_dispatch'"), "automatic finalization must ignore canary publisher runs");
expect(raw["release-finalize.yml"].includes('select(.event == "workflow_dispatch")'), "finalization must select only stable publisher receipts");
expect(raw["release-finalize.yml"].includes("--draft=false"), "only the receipt finalizer may publish the GitHub release");
expect(raw["release-finalize.yml"].includes("npm-publish.yml"), "finalization must bind the combined publisher receipt");
expect(raw["release-finalize.yml"].includes("pypi-release.mjs verify"), "finalization must verify the PyPI wheel hashes");
Expand Down