Skip to content

Commit f0afd3e

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 62cc059 commit f0afd3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/check-license.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ jobs:
5353
DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
5454
echo "Detected license file: $DETECTED_LICENSE_FILE"
5555
if [ "$DETECTED_LICENSE_FILE" != "\"${EXPECTED_LICENSE_FILENAME}\"" ]; then
56-
echo "ERROR: detected license file doesn't match expected: $EXPECTED_LICENSE_FILENAME"
56+
echo "::error file=${DETECTED_LICENSE_FILE}::detected license file $DETECTED_LICENSE_FILE doesn't match expected: $EXPECTED_LICENSE_FILENAME"
5757
EXIT_STATUS=1
5858
fi
5959
6060
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
6161
echo "Detected license type: $DETECTED_LICENSE_TYPE"
6262
if [ "$DETECTED_LICENSE_TYPE" != "\"${EXPECTED_LICENSE_TYPE}\"" ]; then
63-
echo "ERROR: detected license type doesn't match expected $EXPECTED_LICENSE_TYPE"
63+
echo "::error file=${DETECTED_LICENSE_FILE}::detected license type $DETECTED_LICENSE_TYPE doesn't match expected \"${EXPECTED_LICENSE_TYPE}\""
6464
EXIT_STATUS=1
6565
fi
6666

0 commit comments

Comments
 (0)