From 4e0fc22023f6572a4eecaaef4f4a7c6162c2fcac Mon Sep 17 00:00:00 2001 From: "T.Tian" Date: Tue, 16 Jan 2024 15:17:36 +0800 Subject: [PATCH] update api yml --- .github/workflows/update_api.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update_api.yml b/.github/workflows/update_api.yml index cc183d68..f0327554 100644 --- a/.github/workflows/update_api.yml +++ b/.github/workflows/update_api.yml @@ -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' @@ -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 }}