Skip to content

Commit

Permalink
update api yml
Browse files Browse the repository at this point in the history
  • Loading branch information
alchem0x2A committed Jan 16, 2024
1 parent dcc4a39 commit 4e0fc22
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/update_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ jobs:
python -m sparc.docparser --git --include-subdirs
- name: Env variable for api version
run: |
python -c "from sparc.api import SparcAPI; import os; ver=SparcAPI('parameters.json').sparc_version; os.system(f'echo API_VERSION={ver} >> $GITHUB_ENV')"
python -c "from sparc.api import SparcAPI; import os; ver=SparcAPI().sparc_version; os.system(f'echo API_VERSION={ver} >> $GITHUB_ENV')"
- name: Test if json api is newer than current
id: probe
run: |
echo "UPDATE_NEEDED=false" >> $GITHUB_ENV
python .github/workflows/api_version_probe.py || echo "UPDATE_NEEDED=true" >> $GITHUB_ENV
if python .github/workflows/api_version_probe.py; then
echo "UPDATE_NEEDED=false" >> $GITHUB_ENV
else
echo "UPDATE_NEEDED=true" >> $GITHUB_ENV
fi
continue-on-error: true
- name: Create Pull Request
if: ${{ env.UPDATE_NEEDED }} == 'true'
Expand All @@ -53,7 +56,7 @@ jobs:
git add sparc/sparc_json_api/parameters.json
git commit -m "Add new json api version ${API_VERSION}"
git push --set-upstream origin api_version
gh pr create --base master --title "[PR Bot] New JSON API version ${API_VERSION}" --body "Merge new JSON API version ${API_VERSION} into master" -R alchem0x2a/SPARC-X-API
gh pr create --base master --title "[PR Bot] New JSON API version ${API_VERSION}" --body "Merge new JSON API version ${API_VERSION} into master" -R ${{ github.repository_owner }}/SPARC-X-API
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 4e0fc22

Please sign in to comment.