forked from spacetelescope/romancal
-
Notifications
You must be signed in to change notification settings - Fork 0
26 lines (24 loc) · 907 Bytes
/
contexts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: contexts
on:
workflow_call:
outputs:
roman:
value: ${{ jobs.contexts.outputs.roman }}
workflow_dispatch:
jobs:
contexts:
name: retrieve latest CRDS contexts
runs-on: ubuntu-latest
outputs:
roman: ${{ steps.roman_crds_context.outputs.pmap }}
steps:
- id: roman_crds_context
env:
OBSERVATORY: roman
CRDS_SERVER_URL: https://roman-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 |
python -c "import sys, json; print(json.load(sys.stdin)['result'])"
)" >> $GITHUB_OUTPUT
- run: if [[ ! -z "${{ steps.roman_crds_context.outputs.pmap }}" ]]; then echo ${{ steps.roman_crds_context.outputs.pmap }}; else exit 1; fi