-
Notifications
You must be signed in to change notification settings - Fork 19
66 lines (61 loc) · 1.81 KB
/
parse.yaml
File metadata and controls
66 lines (61 loc) · 1.81 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
59
60
61
62
63
64
65
66
name: Parse
on:
push:
paths:
- github-status-history.atom
workflow_run:
workflows:
- Flat
types:
- completed
workflow_dispatch:
permissions:
contents: write
jobs:
parse:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup uv
uses: astral-sh/setup-uv@v3
- name: Run parser
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 5
retry_on: error
retry_wait_seconds: 30
command: |
uv run python scripts/extract_incidents.py \
--out parsed \
--incidents-format jsonl \
--enrich-impact \
--impact-delay 0.1
- name: Commit outputs
run: |
if git status --porcelain | grep .; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add parsed .cache/impact.json
git commit -m "automation: update parsed incidents"
max_attempts=3
attempt=1
while true; do
if git push origin HEAD:master; then
break
fi
if [ "$attempt" -ge "$max_attempts" ]; then
echo "Push failed after ${max_attempts} attempts."
exit 1
fi
echo "Push rejected; rebasing on origin/master and retrying..."
git pull --rebase origin master
attempt=$(( attempt + 1 ))
done
else
echo "No changes to commit."
fi