Skip to content

Commit 26e7e90

Browse files
committed
Always check both license filename and type in "Check License" workflow
This might provide some additional useful context to the reader in the event of a failure.
1 parent ddd9547 commit 26e7e90

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/check-license.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,22 @@ jobs:
4545

4646
- name: Check license file
4747
run: |
48+
EXIT_STATUS=0
4849
# See: https://github.com/licensee/licensee
4950
LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)"
5051
5152
DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
5253
echo "Detected license file: $DETECTED_LICENSE_FILE"
5354
if [ "$DETECTED_LICENSE_FILE" != "\"$EXPECTED_LICENSE_FILENAME\"" ]; then
5455
echo "ERROR: detected license file doesn't match expected: $EXPECTED_LICENSE_FILENAME"
55-
exit 1
56+
EXIT_STATUS=1
5657
fi
5758
5859
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
5960
echo "Detected license type: $DETECTED_LICENSE_TYPE"
6061
if [ "$DETECTED_LICENSE_TYPE" != "\"$EXPECTED_LICENSE_TYPE\"" ]; then
6162
echo "ERROR: detected license type doesn't match expected $EXPECTED_LICENSE_TYPE"
62-
exit 1
63+
EXIT_STATUS=1
6364
fi
65+
66+
exit $EXIT_STATUS

0 commit comments

Comments
 (0)