Skip to content

Commit 31c7b19

Browse files
committed
Fix output ID logic
1 parent 3ed2787 commit 31c7b19

1 file changed

Lines changed: 15 additions & 17 deletions

File tree

.github/workflows/test_workflow.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,25 @@ jobs:
1212
get_image_tag:
1313
runs-on: ubuntu-latest
1414
outputs:
15-
image: ${{ steps.docker_tag.outputs.image }}
16-
steps:
17-
18-
- name: Validate inputs
19-
run: |
20-
if [[ "${{ inputs.dolfinx_tag }}" != "stable" && "${{ inputs.dolfinx_tag }}" != "nightly" ]]; then
21-
echo "::error::Invalid DOLFINx environment: ${{ inputs.dolfinx_tag }}. Allowed values: stable, nightly"
22-
exit 1
23-
fi
24-
25-
- id: Nightly
26-
if: (${{ inputs.dolfinx_tag }} == 'nightly')
27-
run: |
15+
image: ${{ steps.tagger.outputs.image }}
16+
steps:
17+
- name: Validate inputs
18+
run: |
19+
if [[ "${{ inputs.dolfinx_tag }}" != "stable" && "${{ inputs.dolfinx_tag }}" != "nightly" ]]; then
20+
echo "::error::Invalid DOLFINx environment. Allowed: stable, nightly"
21+
exit 1
22+
fi
23+
24+
- id: tagger
25+
run: |
26+
# 2. Handle the 'if' logic inside the script
27+
if [[ "${{ inputs.dolfinx_tag }}" == "nightly" ]]; then
2828
echo "branch=main" >> $GITHUB_OUTPUT
2929
echo "image=current" >> $GITHUB_OUTPUT
30-
31-
- id: Stable
32-
if: (${{ inputs.dolfinx_tag }} == 'stable')
33-
run: |
30+
else
3431
echo "branch=release" >> $GITHUB_OUTPUT
3532
echo "image=stable" >> $GITHUB_OUTPUT
33+
fi
3634
3735
3836
test-code:

0 commit comments

Comments
 (0)