Skip to content

Commit

Permalink
Merge pull request #438 from ncihtan/workflow-fix
Browse files Browse the repository at this point in the history
Workflow fix
  • Loading branch information
adamjtaylor authored Jul 12, 2024
2 parents 703d691 + 72ad8fe commit 93c8cb3
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions .github/workflows/ci-lint-validate-convert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ concurrency:
# {{ github.sha }}: full commit sha
# credit: https://github.com/Sage-Bionetworks-Workflows/sagetasks/blob/main/.github/workflows/ci.yml
group: >-
${{ github.workflow }}-${{ github.ref_type }}-
${{ github.sha }}
${{ github.workflow }}-${{ github.ref_type }}-${{ github.sha }}
cancel-in-progress: true

env:
Expand All @@ -38,29 +37,21 @@ jobs:
name: Validate CSV
if: always()
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install IPython
run: |
pip install ipython==8.18.1
- name: Install Schematic
shell: bash
run: |
pip install schematicpy==$SCHEMATIC_VERSION
- name: Convert CSV schema
shell: bash
run: |
schematic schema convert .github/CSV.model.csv
- name: Validate data model CSV
shell: bash
run: |
schematic model -c .github/CSV_schematic_config.yml validate -mp HTAN.model.csv -dt "DataModel" |
grep "Your manifest has been validated successfully. There are no errors in your manifest, and it can be submitted without any modifications."
Expand All @@ -71,39 +62,36 @@ jobs:
- lint
- validate
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install IPython
run: |
pip install ipython==8.18.1
- name: Install Schematic
shell: bash
run: |
pip install schematicpy==$SCHEMATIC_VERSION
- name: Convert .csv to .jsonld
shell: bash
run: |
schematic schema convert HTAN.model.csv
- uses: r-lib/actions/pr-fetch@v2
- name: Set up Git user
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Fetch PR details
if: github.event_name == 'pull_request'
uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Commit the changes
run: |
# Specifying the full email allows the avatar to show up: https://github.com/orgs/community/discussions/26560
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add HTAN.model.jsonld
git commit -m "GitHub Action: convert *.model.csv to *.model.jsonld" || echo "No changes to commit"
- uses: r-lib/actions/pr-push@v2
- name: Push changes back to PR
if: github.event_name == 'pull_request'
uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 93c8cb3

Please sign in to comment.