Skip to content

Commit 97fca1c

Browse files
authored
Update template-pr-ci.yml
1 parent bce2a31 commit 97fca1c

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/template-pr-ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ jobs:
1414
python-version: ["3.12"]
1515
steps:
1616
- uses: actions/checkout@v4
17+
- name: Conditionally set up .cdsapirc
18+
shell: bash
19+
run: |
20+
if [ -n "${{ secrets.CDSAPI_KEY }}" ]; then
21+
if [[ "$RUNNER_OS" == "Windows" ]]; then
22+
cdsapirc_path="$USERPROFILE/.cdsapirc"
23+
else
24+
cdsapirc_path="$HOME/.cdsapirc"
25+
fi
26+
echo "url = https://cds.climate.copernicus.eu/api" >> "$cdsapirc_path"
27+
echo "key = ${{ secrets.CDSAPI_KEY }}" >> "$cdsapirc_path"
28+
else
29+
echo "CDSAPI_KEY secret is empty or not set. Skipping .cdsapirc setup."
30+
fi
1731
- name: setup-pixi
1832
uses: prefix-dev/setup-pixi@v0.8.3
1933
- name: Run tests

0 commit comments

Comments
 (0)