From 8a1c8c74c69f33aaa0337ba22b79d7cdbf3a481f Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 13 Aug 2021 14:14:27 -0700 Subject: [PATCH] Use conservative env var brace wrapping in "Check License" workflow Even if it works as intended, it is not clear what the effect is of the escaped quote at the end of the environment variables in the shell commands used to check the license detection results. Wrapping the variable names in braces ensures they are as expected and also makes the working of the code clear. --- .github/workflows/check-license.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-license.yml b/.github/workflows/check-license.yml index e00e6dc..2d8976b 100644 --- a/.github/workflows/check-license.yml +++ b/.github/workflows/check-license.yml @@ -51,14 +51,14 @@ jobs: DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')" echo "Detected license file: $DETECTED_LICENSE_FILE" - if [ "$DETECTED_LICENSE_FILE" != "\"$EXPECTED_LICENSE_FILENAME\"" ]; then + if [ "$DETECTED_LICENSE_FILE" != "\"${EXPECTED_LICENSE_FILENAME}\"" ]; then echo "ERROR: detected license file doesn't match expected: $EXPECTED_LICENSE_FILENAME" EXIT_STATUS=1 fi DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')" echo "Detected license type: $DETECTED_LICENSE_TYPE" - if [ "$DETECTED_LICENSE_TYPE" != "\"$EXPECTED_LICENSE_TYPE\"" ]; then + if [ "$DETECTED_LICENSE_TYPE" != "\"${EXPECTED_LICENSE_TYPE}\"" ]; then echo "ERROR: detected license type doesn't match expected $EXPECTED_LICENSE_TYPE" EXIT_STATUS=1 fi