-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.4 KB
/
gc-reports.yml
File metadata and controls
57 lines (46 loc) · 1.4 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
name: Garbage Collect Reports
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
permissions:
contents: write
id-token: write
actions: write
concurrency:
group: gc-reports
cancel-in-progress: true
env:
UV_FROZEN: 1
jobs:
gc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- run: uv sync
- run: ./maat gc-reports
- name: Set up Git configuration
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
- run: git pull --ff-only
- run: git add -A reports
- name: Check for changes
id: check_changes
shell: bash
run: |
if git diff --cached --quiet; then
echo "has_changes=false" >> "$GITHUB_OUTPUT"
else
echo "has_changes=true" >> "$GITHUB_OUTPUT"
fi
- run: "git commit -m 'gc-reports: prune old reports'"
if: steps.check_changes.outputs.has_changes == 'true'
- run: git push
if: steps.check_changes.outputs.has_changes == 'true'
- name: Trigger Web workflow
if: github.ref == 'refs/heads/main' && steps.check_changes.outputs.has_changes == 'true'
run: gh workflow run web.yml --ref "${{ github.ref }}"
env:
GH_TOKEN: ${{ github.token }}