Update devices in wiki #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |