Skip to content

Commit 2ae057a

Browse files
committed
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.
1 parent 26e7e90 commit 2ae057a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/check-license.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ jobs:
5151
5252
DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
5353
echo "Detected license file: $DETECTED_LICENSE_FILE"
54-
if [ "$DETECTED_LICENSE_FILE" != "\"$EXPECTED_LICENSE_FILENAME\"" ]; then
54+
if [ "$DETECTED_LICENSE_FILE" != "\"${EXPECTED_LICENSE_FILENAME}\"" ]; then
5555
echo "ERROR: detected license file doesn't match expected: $EXPECTED_LICENSE_FILENAME"
5656
EXIT_STATUS=1
5757
fi
5858
5959
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
6060
echo "Detected license type: $DETECTED_LICENSE_TYPE"
61-
if [ "$DETECTED_LICENSE_TYPE" != "\"$EXPECTED_LICENSE_TYPE\"" ]; then
61+
if [ "$DETECTED_LICENSE_TYPE" != "\"${EXPECTED_LICENSE_TYPE}\"" ]; then
6262
echo "ERROR: detected license type doesn't match expected $EXPECTED_LICENSE_TYPE"
6363
EXIT_STATUS=1
6464
fi

0 commit comments

Comments
 (0)