-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lucie Milan
committed
Oct 13, 2023
1 parent
5c2b64f
commit 59c76fc
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Generate foreign keys | ||
on: | ||
push: | ||
paths: | ||
- '**-foreign-keys.yml' | ||
branches: | ||
- '!master' | ||
|
||
jobs: | ||
generate-foreign-keys: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install Python modules | ||
uses: BSFishy/pip-action@v1 | ||
with: | ||
packages: | | ||
pyyaml | ||
- name: Generate foreign keys | ||
run: python generate_foreign_keys.py | ||
working-directory: ./scripts/json | ||
|
||
- name: Check for changes | ||
id: get_changes | ||
run: echo "::set-output name=changed::$(git status --porcelain | wc -l)" | ||
|
||
- name: Commit changes | ||
if: steps.get_changes.outputs.changed != 0 | ||
run: | | ||
git add -A | ||
git config --global user.email "[email protected]" | ||
git config --global user.name 'github-actions' | ||
git commit -am "Automated commit: Generate JSON schemas" | ||
git push |
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