-
Notifications
You must be signed in to change notification settings - Fork 18
40 lines (33 loc) · 979 Bytes
/
update-index.yml
File metadata and controls
40 lines (33 loc) · 979 Bytes
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
name: Update Game Index
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
update-index:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # Important for pushing commits back
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Update INDEX.md
run: |
python update_index.py
- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add INDEX.md
if [[ -n "$(git status --porcelain INDEX.md)" ]]; then
git commit -m "Auto-update INDEX.md with new games [skip ci]"
git push origin HEAD:${GITHUB_REF#refs/heads/}
else
echo "No changes to INDEX.md"
fi