-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessage.sh
executable file
·42 lines (37 loc) · 1.14 KB
/
message.sh
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
#!/usr/bin/env bash
echo 'MSG<<EOF'
echo "*Nightly update*"
if [[ "$(jq 'map(.result == "success") | all' results.json)" == "true" ]]; then
SUCCESS=1
echo '✅✅✅'
else
SUCCESS=0
echo '❌❌❌'
fi
echo ""
echo "*Links:*"
COMMIT="$(git rev-parse HEAD)"
echo "commit: https://github.com/inria-prosecco/circus-green/commit/$COMMIT"
echo "run: https://github.com/inria-prosecco/circus-green/actions/runs/$RUN"
echo ""
echo "*Statuses:*"
for project in hax charon aeneas eurydice ml-kem bertie; do
status="$(jq -r 'if .["'"$project"'"].result == "success" then "✅" else "❌" end' results.json)"
echo "$status $project (main)"
done
echo ""
echo "*Tried to update:*"
git show origin/main:flake.lock > good.lock
cat flake.lock good.lock | jq -s -r '
map( .nodes |
[ .fstar, .karamel, .hax, .charon, .aeneas, .eurydice, .libcrux, .bertie ] |
map( .locked )
)
| transpose
| .[]
| select(.[0].rev != .[1].rev)
| "\(.[1].rev[0:8])..\(.[0].rev[0:8])" as $range
| "\(.[0].repo): [\($range)](https://github.com/\(.[0].owner)/\(.[0].repo)/compare/\($range))"
'
echo EOF
echo "SUCCESS=$SUCCESS"