Skip to content

Commit

Permalink
add foreign keys workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucie Milan committed Oct 13, 2023
1 parent 5c2b64f commit 59c76fc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/generate_foreign_keys.yml
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
2 changes: 1 addition & 1 deletion .github/workflows/get_json_schema_from_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
uses: BSFishy/pip-action@v1
with:
packages: |
requests
pyyaml
- name: Get JSON files
run: python manual_json_import.py ${{ secrets.GITHUB_TOKEN }} ${{ github.event.inputs.tap }} ${{ github.event.inputs.version }} ${{ github.event.inputs.file }}
Expand Down

0 comments on commit 59c76fc

Please sign in to comment.