Skip to content

Commit f407a23

Browse files
committed
Enhance "Check License" workflow's error output
The use of the `error` workflow command will cause the important error message output to be surfaced prominently in the workflow run summary and log. The workflow run logs can be somewhat labyrinthine to those who don't work with them regularly, so finding the previous output to determine what caused the failure might have been challenging.
1 parent 2ae057a commit f407a23

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
@@ -52,14 +52,14 @@ jobs:
5252
DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
5353
echo "Detected license file: $DETECTED_LICENSE_FILE"
5454
if [ "$DETECTED_LICENSE_FILE" != "\"${EXPECTED_LICENSE_FILENAME}\"" ]; then
55-
echo "ERROR: detected license file doesn't match expected: $EXPECTED_LICENSE_FILENAME"
55+
echo "::error file=${DETECTED_LICENSE_FILE}::detected license file $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"
6161
if [ "$DETECTED_LICENSE_TYPE" != "\"${EXPECTED_LICENSE_TYPE}\"" ]; then
62-
echo "ERROR: detected license type doesn't match expected $EXPECTED_LICENSE_TYPE"
62+
echo "::error file=${DETECTED_LICENSE_FILE}::detected license type $DETECTED_LICENSE_TYPE doesn't match expected \"${EXPECTED_LICENSE_TYPE}\""
6363
EXIT_STATUS=1
6464
fi
6565

0 commit comments

Comments
 (0)