Skip to content

Commit

Permalink
fix:update actions, add action for creating combined ontology
Browse files Browse the repository at this point in the history
  • Loading branch information
rmfranken committed Jan 13, 2025
1 parent 7f823a7 commit 6a06918
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/createCombinedTurtle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Run createSchemas.py on push to /schemas

on:
push:
paths:
- 'schemas/**'
paths-ignore:
- 'schemas/ImagingOntologyCombined.ttl'

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.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run createCombinedTurtle.py
run: python src/createCombinedTurtle.py

- name: Set up Git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit changes to current repo
run: |
git add schemas/ImagingOntologyCombined.ttl
git commit -m "Update ImagingOntologyCombined.ttl [from GitHub Actions]"
git push origin main
env:
SECOND_REPO_PAT: ${{ secrets.SECOND_REPO_PAT }}

- name: Clone, create new branch, commit changes and make PR to imaging-fair-calculator repo
run: |
git clone "https://x-access-token:${{ secrets.SECOND_REPO_PAT }}@github.com/sdsc-ordes/imaging-plaza-fair-indicator-api.git"
cd imaging-plaza-fair-indicator-api
git checkout -b combine-ontology-${{ github.run_id }}
cp ../schemas/ImagingOntologyCombined.ttl schemas/
git add schemas/ImagingOntologyCombined.ttl
git commit -m "Update ImagingOntologyCombined.ttl [from GitHub Actions]"
git push https://x-access-token:${{ secrets.SECOND_REPO_PAT }}@github.com/sdsc-ordes/imaging-plaza-fair-indicator-api.git
run: |
gh pr create \
--title "Update ImagingOntologyCombined.ttl [from GitHub Actions]" \
--body "This PR updates the ImagingOntologyCombined.ttl file in the schemas directory." \
--base develop \
--head update-ImagingOntologyCombined-${{ github.run_id }}
env:
SECOND_REPO_PAT: ${{ secrets.SECOND_REPO_PAT }}
GH_TOKEN: ${{ secrets.SECOND_REPO_PAT }}
File renamed without changes.

0 comments on commit 6a06918

Please sign in to comment.