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
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ jobs:
# registry artifact" half-state.
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TAG_NAME: ${{ github.ref_name }}
run: |
set -euo pipefail
Expand Down Expand Up @@ -738,5 +739,6 @@ jobs:
- name: Publish the GitHub Release (un-draft)
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TAG_NAME: ${{ github.ref_name }}
run: gh release edit "$TAG_NAME" --draft=false
5 changes: 5 additions & 0 deletions tests/release_signed_release_invariants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,13 @@ done
# (2) release-assets-draft uploads every required asset class to the Release
# ----------------------------------------------------------------------
body_draft="$(job_body release-assets-draft)"
github_repo_env_re='^[[:space:]]+GH_REPO:[[:space:]]*"?\$\{\{[[:space:]]*github\.repository[[:space:]]*\}\}"?[[:space:]]*$'
for ext in '\.crate' '\.whl' '\.tar\.gz' '\.sigstore\.json' '\.intoto\.jsonl'; do
printf '%s\n' "$body_draft" | grep -qE "dist/\*${ext}([^a-zA-Z]|$)" \
|| fail "release-assets-draft must \`gh release upload\` dist/*$(printf '%s' "$ext" | sed 's/\\//g')"
done
printf '%s\n' "$body_draft" | grep -qE "$github_repo_env_re" \
|| fail "release-assets-draft must set \`GH_REPO: \${{ github.repository }}\` (no checkout, so gh release upload needs explicit repo context)"

# ----------------------------------------------------------------------
# (3) release-assets-draft must NOT un-draft (the dedicated un-draft job owns
Expand Down Expand Up @@ -185,5 +188,7 @@ done
unp="$(job_body publish-github-release)"
printf '%s\n' "$unp" | grep -qE 'gh release edit.*--draft=false' \
|| fail "publish-github-release must \`gh release edit <tag> --draft=false\` (this is the sole un-draft point)"
printf '%s\n' "$unp" | grep -qE "$github_repo_env_re" \
|| fail "publish-github-release must set \`GH_REPO: \${{ github.repository }}\` (no checkout, so gh release edit needs explicit repo context)"

echo "OK: signed-release invariants hold."
Loading