Skip to content

Commit

Permalink
allow overriding CI_CLOUD for PRs using label
Browse files Browse the repository at this point in the history
  • Loading branch information
sjpb committed Aug 15, 2024
1 parent cc515da commit 5a2f5d8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/fatimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Record settings for CI cloud
run: |
echo CI_CLOUD: ${{ env.CI_CLOUD }}
- name: Setup ssh
run: |
set -x
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/stackhpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,23 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Override CI_CLOUD if label is present
if: ${{ github.event_name == 'pull_request' }}
run: |
# Iterate over the labels
labels=$(echo '${{ toJSON(github.event.pull_request.labels) }}' | jq -r '.[].name')
echo $labels
for label in $labels; do
if [[ $label == CI_CLOUD=* ]]; then
# Extract the value after 'CI_CLOUD='
CI_CLOUD_OVERRIDE=${label#CI_CLOUD=}
echo "CI_CLOUD=${CI_CLOUD_OVERRIDE}" >> $GITHUB_ENV
fi
done
- name: Record settings for CI cloud
run: |
echo CI_CLOUD: ${{ vars.CI_CLOUD }}
echo CI_CLOUD: ${{ env.CI_CLOUD }}
- name: Setup ssh
run: |
Expand Down

0 comments on commit 5a2f5d8

Please sign in to comment.