|
60 | 60 | } |
61 | 61 | done |
62 | 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. |
| 63 | + |
| 64 | + lint-pubring: |
| 65 | + if: github.event.pull_request.draft == false |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 69 | + with: |
| 70 | + fetch-depth: 0 # We need 0 to validate the git commit signatures. |
| 71 | + persist-credentials: false |
| 72 | + |
| 73 | + - name: Check if there are any keyring changes |
| 74 | + id: keyring-changes |
| 75 | + run: | |
| 76 | + git diff --exit-code --quiet ${{ github.event_name == 'push' && github.event.before || 'HEAD^' }} -- gpg/ || echo "HAS_CHANGED=true" >> "$GITHUB_OUTPUT" |
| 77 | + git diff --exit-code --quiet ${{ github.event_name == 'push' && github.event.before || 'HEAD^' }} -- gpg-only-active-keys/ || echo "HAS_ACTIVE_CHANGED=true" >> "$GITHUB_OUTPUT" |
| 78 | +
|
| 79 | + - name: Export pubring content |
| 80 | + run: | |
| 81 | + for dir in gpg gpg-only-active-keys; do |
| 82 | + gpg --no-default-keyring --keyring "$dir/pubring.kbx" --list-keys --with-colons > "$dir/all-keys.list" |
| 83 | + gpg --no-default-keyring --keyring "$dir/pubring.kbx" --export --armor > "$dir/all-keys.asc" |
| 84 | + git add "$dir/all-keys.list" "$dir/all-keys.asc" |
| 85 | + done |
| 86 | + - name: Re-generate gpg folders |
| 87 | + run: | |
| 88 | + ./generate-gpg-dir.sh |
| 89 | + for dir in gpg gpg-only-active-keys; do |
| 90 | + gpg --no-default-keyring --keyring "$dir/pubring.kbx" --list-keys --with-colons > "$dir/all-keys.list" |
| 91 | + gpg --no-default-keyring --keyring "$dir/pubring.kbx" --export --armor > "$dir/all-keys.asc" |
| 92 | + done |
| 93 | + - run: git diff --exit-code -- gpg/all-keys.list gpg/all-keys.asc gpg-only-active-keys/all-keys.list gpg-only-active-keys/all-keys.asc |
| 94 | + |
| 95 | + - name: Validate that all non-v0.x releases can be verified using the keyring |
| 96 | + if: steps.keyring-changes.outputs.HAS_CHANGED == 'true' |
| 97 | + run: | |
| 98 | + curl -fs https://nodejs.org/dist/index.json \ |
| 99 | + | jq -er '.[].version | select(startswith("v0.") | not)' \ |
| 100 | + | while read -r VERSION; do |
| 101 | + echo "Checking $VERSION..." |
| 102 | + curl -fs "https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc" \ |
| 103 | + | gpgv --keyring="gpg/pubring.kbx" |
| 104 | + done |
| 105 | + 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