Run createSchemas.py on push to /schemas #4
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: Run createSchemas.py on push to /schemas | |
on: | |
push: | |
paths: | |
- 'schemas/**' | |
workflow_dispatch: # Allows manual triggering of the workflow | |
jobs: | |
run-create-schemas: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run createSchemas.py | |
run: python src/createSchemas.py | |
- name: Commit and push changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add schema.json | |
git commit -m "Update schema.json [from GitHub Actions]" | |
git push origin main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |