Closed djarran closed 5 months ago
Description: There is an issue with the 'ternary' operators in GitHub Actions outlined in this discussion:
There seems to be a way because there is "ternary like" operator in Github actions https://docs.github.com/en/actions/learn-github-actions/expressions#example . One thing to watch for is that "true value" (one after &&) need to be "truthy" to work as expected ${{ github.event_name == 'release' && github.ref || inputs.release_ref }}
There seems to be a way because there is "ternary like" operator in Github actions https://docs.github.com/en/actions/learn-github-actions/expressions#example . One thing to watch for is that "true value" (one after &&) need to be "truthy" to work as expected
${{ github.event_name == 'release' && github.ref || inputs.release_ref }}
This article also describes the same issue as above and outlines the solution that is used in this PR.
Solution:
We flip the condition so that the value to use if true (second operand) is truthy
fetch-depth: ${{ !((contains(github.event_name, 'push') && steps.check-branch.outputs.publishable == 'true')) && 2 || 0 }}
Description: There is an issue with the 'ternary' operators in GitHub Actions outlined in this discussion:
This article also describes the same issue as above and outlines the solution that is used in this PR.
Solution:
We flip the condition so that the value to use if true (second operand) is truthy