-
-
Notifications
You must be signed in to change notification settings - Fork 5
48 lines (39 loc) · 1.16 KB
/
Copy pathupdate-install-sha.yml
File metadata and controls
48 lines (39 loc) · 1.16 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
name: Update install.sh SHA256
on:
push:
branches: ["main"]
paths:
- "local-https.sh"
permissions:
contents: write
concurrency:
group: update-install-sha
cancel-in-progress: true
jobs:
update-sha:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Compute SHA256
id: sha
run: |
HASH="$(sha256sum local-https.sh | awk '{print $1}')"
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
- name: Update install.sh
run: |
HASH="${{ steps.sha.outputs.hash }}"
perl -i -pe 's/^EXPECTED_SHA256_DEFAULT="[^"]*"/EXPECTED_SHA256_DEFAULT="'"$HASH"'"/' install.sh
- name: Commit and push if changed
run: |
if git diff --quiet -- install.sh; then
echo "No changes to install.sh"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add install.sh
git commit -m "chore(install): update expected sha256 [skip ci]"
git push