forked from monero-project/monero-site
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (50 loc) · 1.96 KB
/
Copy pathcontributing-hashes.yml
File metadata and controls
50 lines (50 loc) · 1.96 KB
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
42
43
44
45
46
47
48
49
50
name: Validate Contributing Hashes
on:
push:
paths:
- "src/data/contributing/contributing.json"
- "src/data/contributing/contributing.json.asc"
- "public/contributing/*.png"
pull_request:
paths:
- "src/data/contributing/contributing.json"
- "src/data/contributing/contributing.json.asc"
- "public/contributing/*.png"
workflow_dispatch:
jobs:
validate-contributing-hashes:
name: Validate Contributing Hashes
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get install -y --no-install-recommends curl gpg jq zbar-tools
- name: Verify contributing.json signature
run: |
curl -sL https://raw.githubusercontent.com/monero-project/monero/master/utils/gpg_keys/binaryfate.asc |
gpg --import
gpg --verify src/data/contributing/contributing.json.asc
- name: Verify General Fund donation QR's
run: |
json="src/data/contributing/contributing.json"
for coin in xmr btc; do
qr_checksum=$(jq -r ".${coin}.qr_checksum" "$json")
qr_filename=public/contributing/$(jq -r ".${coin}.qr_filename" "$json")
qr_content=$(jq -r ".${coin}.qr_content" "$json")
echo "DEBUG: $qr_checksum $qr_filename"
echo "DEBUG: $qr_content"
# Confirm hashes match
echo "$qr_checksum $qr_filename" | sha256sum -c
# Scan QR content
qr_scanned=$(zbarimg -q --raw "$qr_filename")
# Compare scanned content with expected content
if [ "$qr_scanned" = "$qr_content" ]; then
echo "${coin^^} QR code content matches exactly"
else
echo "${coin^^} QR code content does not match"
echo "Scanned: $qr_scanned"
echo "Expected: $qr_content"
exit 1
fi
done