Skip to content

Commit af8d471

Browse files
committed
Use multi-line if conditionals, more readable, and restore default 0.
1 parent 88121d7 commit af8d471

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/cpp-packaging.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
description: 'commit ID to package'
1111
preserveIntermediateArtifacts:
1212
description: 'preserve intermediate artifacts?'
13+
default: 0
1314
downloadPublicVersion:
1415
description: 'public version # to test against'
1516
downloadPreviousRun:
@@ -43,8 +44,15 @@ jobs:
4344
echo "::warning ::Using commit ID '${{ github.event.inputs.commitIdToPackage }}' for building and packaging SDK and tests."
4445
fi
4546
fi
47+
4648
- name: log if preserving intermediate artifacts
47-
if: ${{ !(github.event.inputs.preserveIntermediateArtifacts == 0) }}
49+
# Inverse of the conditional on the cleanup_artifacts step.
50+
if: |
51+
!(
52+
(github.event.inputs.preserveIntermediateArtifacts == 0 || github.event.inputs.preserveIntermediateArtifacts == '')
53+
&& github.event.inputs.downloadPublicVersion == ''
54+
&& github.event.inputs.downloadPreviousRun == ''
55+
)
4856
run: echo "::warning ::Intermediate artifacts will be preserved."
4957

5058
build_tools:
@@ -539,7 +547,12 @@ jobs:
539547
name: cleanup-artifacts
540548
runs-on: ubuntu-latest
541549
needs: [merge_packages]
542-
if: ${{ (github.event.inputs.preserveIntermediateArtifacts == 0 || github.event.inputs.preserveIntermediateArtifacts == '') && github.event.inputs.downloadPublicVersion == '' && github.event.inputs.downloadPreviousRun == '' }}
550+
if: |
551+
(
552+
(github.event.inputs.preserveIntermediateArtifacts == 0 || github.event.inputs.preserveIntermediateArtifacts == '')
553+
&& github.event.inputs.downloadPublicVersion == ''
554+
&& github.event.inputs.downloadPreviousRun == ''
555+
)
543556
steps:
544557
- uses: geekyeggo/delete-artifact@v1
545558
with:

0 commit comments

Comments
 (0)