Skip to content

Commit 0298f30

Browse files
committed
GH: add watchtower workflow to check for changes in the wild
1 parent 210b0b0 commit 0298f30

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/watchtower.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Periodically check stuff for changes
2+
3+
on:
4+
schedule:
5+
- cron: "33 3 12 * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
check-hash:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: compare hashes to stored values
13+
env:
14+
FILES: |-
15+
https://apt.armbian.com/armbian.key=45eea660732932370088652b214b85acb426c022529284211d76c12dcb5c9ec3
16+
run: |
17+
# for each line in FILES multi-line string, split into $URI and $HASH using
18+
# parameter expansion # and array expansion. then dl, checksum and compare.
19+
readarray -t lines <<< "$FILES"
20+
for line in "${lines[@]}"; do
21+
URI=${line%%=*}
22+
HASH=${line#*=}
23+
wget -qO- "$URI" | sha256sum | grep "$HASH" || exit 1
24+
echo verified $URI with hash $HASH successfully
25+
done

0 commit comments

Comments
 (0)