-
Notifications
You must be signed in to change notification settings - Fork 2.3k
ci: require signer OTS proof for final releases #10880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,64 @@ jobs: | |
| name: Verify release signatures and binaries | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: git checkout | ||
| uses: actions/checkout@v4 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For |
||
|
|
||
| - name: Check final release OpenTimestamps asset | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Process note: this step runs on |
||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| VERSION: ${{ inputs.version || github.event.release.tag_name }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| if [[ "${VERSION}" =~ \.rc[0-9]+$ ]]; then | ||
| echo "Release candidate ${VERSION}; skipping OpenTimestamps asset check." | ||
| exit 0 | ||
| fi | ||
|
|
||
| REQUIRED_MANIFEST_OTS="manifest-${VERSION}.txt.ots" | ||
| TRUSTED_SIGNERS="$(sed -n \ | ||
| 's/^KEYS+=(.* \([^" ]*\)")$/\1/p' \ | ||
| scripts/verify-install.sh)" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This [[ -n "${TRUSTED_SIGNERS}" ]] || { echo "ERROR: no trusted signers parsed from verify-install.sh"; exit 1; }(FWIW I verified the current regex extracts all 14 signers correctly and handles hyphenated names like |
||
|
|
||
| ASSETS="$(gh release view "${VERSION}" \ | ||
| --repo "${{ github.repository }}" \ | ||
| --json assets \ | ||
| --jq '.assets[].name')" | ||
|
|
||
| if ! grep -Fxq "${REQUIRED_MANIFEST_OTS}" <<< "${ASSETS}"; then | ||
| echo "ERROR: Final release ${VERSION} is missing ${REQUIRED_MANIFEST_OTS}." | ||
| exit 1 | ||
| fi | ||
|
|
||
| MATCHING_SIG="" | ||
| MATCHING_SIG_OTS="" | ||
| while IFS= read -r asset; do | ||
| if [[ "${asset}" != manifest-*-"${VERSION}".sig.ots ]]; then | ||
| continue | ||
| fi | ||
|
|
||
| sig="${asset%.ots}" | ||
| signer="${sig%-$VERSION.sig}" | ||
| signer="${signer#manifest-}" | ||
| if grep -Fxq "${signer}" <<< "${TRUSTED_SIGNERS}" && | ||
| grep -Fxq "${sig}" <<< "${ASSETS}"; then | ||
|
|
||
| MATCHING_SIG="${sig}" | ||
| MATCHING_SIG_OTS="${asset}" | ||
| break | ||
| fi | ||
| done <<< "${ASSETS}" | ||
|
|
||
| if [[ -z "${MATCHING_SIG_OTS}" ]]; then | ||
| echo "ERROR: Final release ${VERSION} is missing an OpenTimestamps proof for an uploaded manifest signature." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Found required OpenTimestamps artifacts:" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Worth being explicit that this gate verifies the presence of the |
||
| echo " ${REQUIRED_MANIFEST_OTS}" | ||
| echo " ${MATCHING_SIG_OTS} for ${MATCHING_SIG}" | ||
|
|
||
| - name: Verify release | ||
| env: | ||
| VERSION: ${{ inputs.version || github.event.release.tag_name }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit (pre-existing wording carried into this edited line): "in addition time-stamping the git tag" reads as missing a "to" — "in addition to time-stamping the git tag". Easy to fix while this line is already being rewritten.