diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 932ae63efe..1e6e0a2ff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: envs: | - linux: check-dependencies latest_crds_contexts: - uses: spacetelescope/crds/.github/workflows/contexts.yml@94138b4501c9487535fd6b977492fc1a2c319708 # 12.0.2 + uses: ./.github/workflows/contexts.yml crds_context: needs: [ latest_crds_contexts ] runs-on: ubuntu-latest diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index d116e6e938..05146f9fb2 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -23,7 +23,7 @@ concurrency: jobs: latest_crds_contexts: - uses: spacetelescope/crds/.github/workflows/contexts.yml@94138b4501c9487535fd6b977492fc1a2c319708 # 12.0.2 + uses: ./.github/workflows/contexts.yml crds_context: needs: [ latest_crds_contexts ] runs-on: ubuntu-latest diff --git a/.github/workflows/contexts.yml b/.github/workflows/contexts.yml new file mode 100644 index 0000000000..b3047bdb63 --- /dev/null +++ b/.github/workflows/contexts.yml @@ -0,0 +1,26 @@ +name: contexts + +on: + workflow_call: + outputs: + jwst: + value: ${{ jobs.contexts.outputs.jwst }} + workflow_dispatch: + +jobs: + contexts: + name: retrieve latest CRDS contexts + runs-on: ubuntu-latest + outputs: + jwst: ${{ steps.jwst_crds_context.outputs.pmap }} + steps: + - id: jwst_crds_context + env: + OBSERVATORY: jwst + CRDS_SERVER_URL: https://jwst-crds.stsci.edu + run: > + echo "pmap=$( + curl -s -X POST -d '{"jsonrpc": "1.0", "method": "get_default_context", "params": ["${{ env.OBSERVATORY }}", null], "id": 1}' ${{ env.CRDS_SERVER_URL }}/json/ --retry 8 --connect-timeout 10 | + python -c "import sys, json; print(json.load(sys.stdin)['result'])" + )" >> $GITHUB_OUTPUT + - run: if [[ ! -z "${{ steps.jwst_crds_context.outputs.pmap }}" ]]; then echo ${{ steps.jwst_crds_context.outputs.pmap }}; else exit 1; fi diff --git a/.github/workflows/tests_devdeps.yml b/.github/workflows/tests_devdeps.yml index 6beefbdaa6..e5ad86b187 100644 --- a/.github/workflows/tests_devdeps.yml +++ b/.github/workflows/tests_devdeps.yml @@ -32,7 +32,7 @@ concurrency: jobs: latest_crds_contexts: - uses: spacetelescope/crds/.github/workflows/contexts.yml@94138b4501c9487535fd6b977492fc1a2c319708 # 12.0.2 + uses: ./.github/workflows/contexts.yml crds_context: needs: [ latest_crds_contexts ] runs-on: ubuntu-latest