-
Notifications
You must be signed in to change notification settings - Fork 85
41 lines (34 loc) · 1.28 KB
/
check_checksums.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Check Checksums
on:
release:
types: [published, prereleased]
jobs:
compare:
name: Compare checksums
runs-on: macos-latest
environment: Release
permissions:
contents: write # to append checksum for each commit
actions: read # to read artifacts
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate checksums from artifacts
run: ruby ./scripts/release-checksums.rb ${{ github.event.release.tag_name }} | tee generated_checksums.txt
- name: Fetch checksums from release note
run: |
curl "https://api.github.com/repos/nervosnetwork/neuron/releases/tags/${{ github.event.release.tag_name }}" |\
python3 -c "import sys, json; print(\"\n\".join(json.load(sys.stdin)['body'].splitlines()[-11:]))" |\
tee release_note_checksums.txt
- name: Compare
run: diff generated_checksums.txt release_note_checksums.txt
- id: comment_body
run: |
body=$(cat generated_checksums.txt)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "body=$body" >> $GITHUB_OUTPUT
- uses: peter-evans/commit-comment@v3
with:
body: ${{ steps.comment_body.outputs.body }}