Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependency-review-action cannot find a license for dependency-review-action #182

Closed
ericcornelissen opened this issue Aug 4, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@ericcornelissen
Copy link
Contributor

On the first run this Action did in one of my repositories (first time using it) I looked at the output and noticed a curious log (full logs here):

We could not detect a license for the following dependencies:
.github/workflows/deps-analysis.yml » actions/dependency-review-action@2.0.4

From what I can tell, this repositories' license is present and well-formed (there's a LICENSE file, as well as the "license" entry in package.json, and GitHub displays the correct license in the UI).

I'm not sure what exactly the problem is, but I would not expect this Action to log a "problem" with itself.

@RobPasMue
Copy link

Also experiencing this issue in some of my repos... looking forward to its resolution! =)

@jcasner
Copy link

jcasner commented Sep 27, 2022

I'm finding this issue in testing this action, also. I tried importing a package with a proper license entry in it's package.json as well as a LICENSE file but am getting this message and not seeing the expected failure from the action.

EDIT
Updating with some details. In order to test this, I added a package (https://github.com/joachimdalen/DevUI) that is listed as GPL-3.0 on npm and github.

I peeked under the covers at the github action and it is pulling the license from the github dependency-graph API

GET /repos/{owner}/{repo}/dependency-graph/compare/{baseRef}...{headRef}

For some packages, we're getting correct values (e.g.: dayjs is getting correctly marked with the MIT license). However, for this one the license is null in the API response, which the action can't interpret (obviously). I think this actually needs to be filed with the github API.

  {
    "change_type": "added",
    "manifest": "package-lock.json",
    "ecosystem": "npm",
    "name": "@joachimdalen/devui",
    "version": "2.0.0-rc12",
    "package_url": "pkg:npm/%40joachimdalen/devui@2.0.0-rc12",
    "license": null,
    "source_repository_url": "https://github.com/joachimdalen/DevUI",
    "scope": "runtime",
    "vulnerabilities": []
  },

@febuiles
Copy link
Contributor

@jcasner Thanks for diving into this, to add further details: The API only returns licenses for the top N licenses for any given repo (not sure if N is the same for all ecosystems). I'm thinking that the best way to proceed here is to call the GitHub licenses API endpoint if license :null in the vulnerabilities payload, what do you think?

@febuiles
Copy link
Contributor

License detection was improved in the latest release of the Action by adding a fallback to GitHub's License API. Please re-open this issue if you're still experiencing problems.

@raphaeldeem-jsq
Copy link

I am encountering this issue, is there a workaround to prevent the tool from flagging itself? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants