Repository navigation
58 lines (49 loc) · 2.05 KB
/
Copy pathweekly.yml
File metadata and controls
58 lines (49 loc) · 2.05 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Every Monday: rebuild the catalog of every public layer, run every starter against
# its live source, commit what changed in data/, and open an issue if a starter broke.
# devsa.community/localhost reads data/ from this repo.
name: Weekly check
on:
schedule:
- cron: "0 13 * * 1" # Mondays, 8 AM in San Antonio (7 AM in winter)
workflow_dispatch:
permissions:
contents: write
issues: write
concurrency:
group: weekly-check
cancel-in-progress: false
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Rebuild the catalog
run: python3 scripts/catalog.py
- name: Run every starter
id: check
continue-on-error: true
run: python3 scripts/check.py | tee check.txt
- name: Commit data/
run: |
git config user.name "github-actions[bot]"
git config user.email "41898333+github-actions[bot]@users.noreply.github.com"
git add data/
git diff --cached --quiet || git commit -m "Weekly check: refresh the catalog and starter status"
git push
- name: Open an issue if a starter broke
if: steps.check.outcome == 'failure'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh label create starter-broken --color d73a4a --description "A starter failed the weekly check" --force
body="$(printf 'The weekly check found a starter that no longer runs against its live source. Usually a publisher changed a field or an address.\n\n```\n%s\n```\n\nRun: %s/%s/actions/runs/%s' "$(cat check.txt)" "$GITHUB_SERVER_URL" "$GITHUB_REPOSITORY" "$GITHUB_RUN_ID")"
open="$(gh issue list --label starter-broken --state open --json number --jq '.[0].number')"
if [ -n "$open" ]; then
gh issue comment "$open" --body "$body"
else
gh issue create --title "A starter broke in the weekly check" --label starter-broken --body "$body"
fi