Work around test -v not being available in Mac Bash
This commit is contained in:
parent
1d311fe8e5
commit
6699d47420
2 changed files with 8 additions and 2 deletions
5
.github/workflows/__go-reconciled-tracing-custom-build-steps.yml
generated
vendored
5
.github/workflows/__go-reconciled-tracing-custom-build-steps.yml
generated
vendored
|
|
@ -93,7 +93,10 @@ jobs:
|
||||||
TEST_MODE: true
|
TEST_MODE: true
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [[ -v CODEQL_ACTION_DID_AUTOBUILD_GOLANG ]]; then
|
# Once we start running Bash 4.2 in all environments, we can replace the
|
||||||
|
# `! -z` flag with the more elegant `-v` which confirms that the variable
|
||||||
|
# is actually unset and not potentially set to a blank value.
|
||||||
|
if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then
|
||||||
echo "Expected the Go autobuilder not to be run, but the" \
|
echo "Expected the Go autobuilder not to be run, but the" \
|
||||||
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
|
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,10 @@ steps:
|
||||||
TEST_MODE: true
|
TEST_MODE: true
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [[ -v CODEQL_ACTION_DID_AUTOBUILD_GOLANG ]]; then
|
# Once we start running Bash 4.2 in all environments, we can replace the
|
||||||
|
# `! -z` flag with the more elegant `-v` which confirms that the variable
|
||||||
|
# is actually unset and not potentially set to a blank value.
|
||||||
|
if [[ ! -z "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" ]]; then
|
||||||
echo "Expected the Go autobuilder not to be run, but the" \
|
echo "Expected the Go autobuilder not to be run, but the" \
|
||||||
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
|
"CODEQL_ACTION_DID_AUTOBUILD_GOLANG environment variable was set."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue