-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.84 KB
/
mirrorcheck.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: "Check mirrors"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
checkmirrors:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository, and to create issues:
contents: write
issues: write
steps:
# Clone the tock-mirrorcheck repo
- uses: actions/checkout@v4
# Setup Python and install dependencies:
- uses: actions/setup-python@v5
- name: Install Python Dependencies
run: pip install -r requirements.txt
# TODO: insert step that fetches new URLs from various Tock repositories
# Check mirrors:
- name: Check mirrors
run: |
./mirrorcheck.py -v \
check-mirrors \
-u urls.json \
-m mirrors.json \
--gh-issue-template gh_issue_template.md.j2 \
--gh-issue-out issue.md \
--diff
# Copy the "unknown_error_issue.md" file if the previous script has not
# created an issue file, but errored (e.g., if it crashed with an
# exception):
- name: Copy unknown error issue template if no issue was templated
if: failure()
run: |
test ! -f issue.md && cp unknown_error_issue.md issue.md
# Create an issue, if the mirrorcheck script reported errors:
- uses: JasonEtco/create-an-issue@v2
if: failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: issue.md
# Commit changes back to repo:
- uses: stefanzweifel/git-auto-commit-action@v5
if: always() # Run even if the script reported errors
with:
commit_message: Update mirror check results
commit_user_name: Mirrorcheck Bot
commit_user_email: [email protected]
commit_author: Mirrorcheck Bot <[email protected]>