-
Notifications
You must be signed in to change notification settings - Fork 9
61 lines (53 loc) · 1.59 KB
/
update-readme.yml
File metadata and controls
61 lines (53 loc) · 1.59 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
name: 📋 Update README
on:
workflow_dispatch: # Manual triggering
issues: # Triggers on issue events
types:
- opened
- edited
- closed
- reopened
- labeled
- unlabeled
- assigned
- unassigned
- pinned
- unpinned
issue_comment: # Triggers on issue comment events
types:
- created
push: # Triggers on push events
jobs:
generate-svgs:
name: Generate SVGs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: pip install -r .github/scripts/readme_svgs/requirements.txt
- name: Run script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python .github/scripts/readme_svgs/gen_status_cards.py
python .github/scripts/readme_svgs/gen_issue_cards.py
- name: Save generated SVGs temporarily
run: |
mkdir -p "$RUNNER_TEMP/tmp_svgs"
cp *.svg "$RUNNER_TEMP/tmp_svgs/"
- name: Create orphan branch and commit SVGs
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout --orphan generated-svgs
git reset --hard
git clean -fdx
cp "$RUNNER_TEMP/tmp_svgs/"*.svg ./
git add *.svg
git commit -m "Auto-update README SVGs"
- name: Push orphan branch
run: git push --force origin generated-svgs