Skip to content

Commit c8a2744

Browse files
committed
chore(ci): validate non-EOL releases are signed with an "active" key (#43)
1 parent d6919b2 commit c8a2744

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,25 @@ jobs:
3838
echo
3939
sed -n '\#^<!-- /Retired keys -->$#,$p' README.md
4040
} | diff README.md -
41+
42+
lint-latest-releases:
43+
if: github.event.pull_request.draft == false
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Validate that latest versions of all non-EOL release lines can be verified using the "only-active-keys" keyring
47+
run: |
48+
set -x
49+
curl -fsLo pubring.kbx "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/raw/$GITHUB_SHA/gpg-only-active-keys/pubring.kbx"
50+
curl -fso index.json https://nodejs.org/dist/index.json
51+
curl -fsL https://github.com/nodejs/Release/raw/HEAD/schedule.json \
52+
| jq -er 'to_entries.[] | select(("\(.value.end)T00:00:00Z" | fromdate) > now) | .key' \
53+
| while read -r RELEASE_LINE; do
54+
echo "Resolving latest $RELEASE_LINE..."
55+
VERSION=$(jq -r --arg RELEASE_LINE "$RELEASE_LINE" 'first(.[] | select(.version | startswith($RELEASE_LINE))) | .version' < index.json)
56+
[ -z "$VERSION" ] || {
57+
echo "Checking $VERSION..."
58+
curl --fail --silent "https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc" \
59+
| gpgv --keyring=./pubring.kbx
60+
}
61+
done
62+
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.

0 commit comments

Comments
 (0)