initial SSR400 and 440 devicemaps #26
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: Generate Templates | |
on: | |
pull_request: | |
branches: [ "master" ] | |
permissions: write-all | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.6 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.6" | |
- name: setup git config | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
- name: Checkout PR | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh pr checkout ${{ github.event.pull_request.number }} | |
- name: Run Template Gen | |
run: | | |
python3 generate_templates.py | |
- name: Git Add Templates | |
run: git add templates/. | |
- name: check for changes | |
run: | | |
if git diff --staged --exit-code; then | |
echo "changes_exist=false" >> "$GITHUB_ENV" | |
else | |
echo "changes_exist=true" >> "$GITHUB_ENV" | |
fi | |
- name: Git commit and push templates | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: env.changes_exist == 'true' | |
run: | | |
git commit -m "Autogenerated commit for templates" | |
git push |