This repository was archived by the owner on Mar 15, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 229
40 lines (37 loc) · 1.62 KB
/
check-mirrors.yml
File metadata and controls
40 lines (37 loc) · 1.62 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
name: Check Mirrors
on:
schedule: [{ cron: "0 22 * * *" }]
workflow_dispatch: null
pull_request: { paths: ["assets/community-mirrors.ziggy"] }
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Zig
# We can't use mlugg/setup-zig, because that Action uses the community mirror list, which
# this workflow is in the "supply chain" for. Instead, just directly fetch a tarball from
# ziglang.org. This is **not** a recommended strategy for most users, but rather a special
# case due to the role this repository plays in maintaining the mirror list.
run: |
curl -L 'https://ziglang.org/download/0.15.2/zig-x86_64-linux-0.15.2.tar.xz' | tar -xJ
mv 'zig-x86_64-linux-0.15.2' zig
echo "$PWD/zig" >>"$GITHUB_PATH"
- name: Check Mirrors
run: zig build --build-file check-mirrors/build.zig
run -- assets/community-mirrors.ziggy "$GITHUB_STEP_SUMMARY"
notify-failure:
runs-on: ubuntu-latest
needs: [check]
if: ${{ always() && (github.event_name != 'pull_request') && (needs.check.result == 'failure' || needs.check.result == 'timed_out') }}
steps:
- name: Send Notification
env:
PUSHOVER_USER: ${{ secrets.MIRROR_CHECK_PUSHOVER_USER }}
PUSHOVER_TOKEN: ${{ secrets.MIRROR_CHECK_PUSHOVER_TOKEN }}
run: curl -s
-F user="$PUSHOVER_USER"
-F token="$PUSHOVER_TOKEN"
-F message="Zig download mirror validation failed"
https://api.pushover.net/1/messages.json