forked from xyzroe/XZG
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.23 KB
/
update_devices.yml
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
name: Update devices in wiki
permissions:
contents: write
on:
workflow_dispatch:
push:
branches:
- main
paths:
- src/const/hw.cpp
jobs:
update-devices:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v2
with:
ref: main
path: main_branch
- name: Checkout mkdocs branch
uses: actions/checkout@v2
with:
ref: mkdocs
path: mkdocs_branch
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run update_devices.py
run: python main_branch/.github/scripts/update_devices.py
- name: Commit and push changes
run: |
cd mkdocs_branch
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
if [[ -n $(git status --porcelain) ]]; then
git add docs/features.md
git commit -m 'Update features.md with new device data'
git push origin mkdocs
else
echo "No changes to commit"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}