Skip to content

Commit 5a2f5d8

Browse files
committed
allow overriding CI_CLOUD for PRs using label
1 parent cc515da commit 5a2f5d8

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/fatimage.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v2
3131

32+
- name: Record settings for CI cloud
33+
run: |
34+
echo CI_CLOUD: ${{ env.CI_CLOUD }}
35+
3236
- name: Setup ssh
3337
run: |
3438
set -x

.github/workflows/stackhpc.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,23 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v2
4141

42+
- name: Override CI_CLOUD if label is present
43+
if: ${{ github.event_name == 'pull_request' }}
44+
run: |
45+
# Iterate over the labels
46+
labels=$(echo '${{ toJSON(github.event.pull_request.labels) }}' | jq -r '.[].name')
47+
echo $labels
48+
for label in $labels; do
49+
if [[ $label == CI_CLOUD=* ]]; then
50+
# Extract the value after 'CI_CLOUD='
51+
CI_CLOUD_OVERRIDE=${label#CI_CLOUD=}
52+
echo "CI_CLOUD=${CI_CLOUD_OVERRIDE}" >> $GITHUB_ENV
53+
fi
54+
done
55+
4256
- name: Record settings for CI cloud
4357
run: |
44-
echo CI_CLOUD: ${{ vars.CI_CLOUD }}
58+
echo CI_CLOUD: ${{ env.CI_CLOUD }}
4559
4660
- name: Setup ssh
4761
run: |

0 commit comments

Comments
 (0)