Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/update-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,28 @@ jobs:
branch: update-license-db
delete-branch: true
labels: dependencies

report:
needs: update
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Open, update or close the failure issue
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
FAILED: ${{ contains(needs.*.result, 'failure') }}
TITLE: ${{ github.workflow }} workflow is failing
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
issue=$(gh issue list --state open --search "in:title \"$TITLE\"" --json number,title \
--jq '.[] | select(.title == env.TITLE) | .number' | head -n1)
if [ "$FAILED" != true ]; then
if [ -n "$issue" ]; then gh issue close "$issue" --comment "Passing again: $RUN_URL"; fi
elif [ -n "$issue" ]; then
gh issue comment "$issue" --body "Failed again: $RUN_URL"
else
gh issue create --title "$TITLE" --body "Scheduled run failed: $RUN_URL"
fi
3 changes: 2 additions & 1 deletion licensedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ func TestLicenseDataParses(t *testing.T) {
continue
}
expression := key
if entry.IsException && lookupLicense(key) == "" {
// ScanCode and SPDX can disagree on whether a key is an exception.
if lookupLicense(key) == "" && (entry.IsException || lookupException(key) != "") {
expression = "GPL-2.0-only WITH " + key
}
if _, err := ParseSyntax(expression); err != nil {
Expand Down
5 changes: 0 additions & 5 deletions normalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ func lookupException(s string) string {
return lookupFolded(s, exceptionMap, exceptionFoldMap)
}

// isValidLicenseOrException checks if the string is a valid license or exception.
func isValidLicenseOrException(s string) bool {
return lookupLicense(s) != "" || lookupException(s) != ""
}

func makeFoldMap(source map[string]string) map[uint64][]string {
result := make(map[uint64][]string, len(source))
for _, canonical := range source {
Expand Down
Binary file removed spdx.test
Binary file not shown.