You've already forked library-registry
mirror of
https://github.com/arduino/library-registry.git
synced 2025-07-29 14:01:15 +03:00
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.
This commit is contained in:
7
.github/workflows/check-license.yml
vendored
7
.github/workflows/check-license.yml
vendored
@ -46,6 +46,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Check license file
|
- name: Check license file
|
||||||
run: |
|
run: |
|
||||||
|
EXIT_STATUS=0
|
||||||
# See: https://github.com/licensee/licensee
|
# See: https://github.com/licensee/licensee
|
||||||
LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)"
|
LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)"
|
||||||
|
|
||||||
@ -53,12 +54,14 @@ jobs:
|
|||||||
echo "Detected license file: $DETECTED_LICENSE_FILE"
|
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"
|
echo "ERROR: detected license file doesn't match expected: $EXPECTED_LICENSE_FILENAME"
|
||||||
exit 1
|
EXIT_STATUS=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
|
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
|
||||||
echo "Detected license type: $DETECTED_LICENSE_TYPE"
|
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"
|
echo "ERROR: detected license type doesn't match expected $EXPECTED_LICENSE_TYPE"
|
||||||
exit 1
|
EXIT_STATUS=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit $EXIT_STATUS
|
||||||
|
Reference in New Issue
Block a user