fair-software / howfairis-github-action

GitHub Action to analyze a GitHub repository’s compliance with the fair-software.eu recommendations.
Apache License 2.0
19 stars 5 forks source link

Add initial license check #8

Closed smsaladi closed 3 years ago

smsaladi commented 4 years ago

2

jspaaks commented 4 years ago

Thanks for the PR. I'm having some problems getting it to run locally though. I tried installing licensee with gem install licensee, but this fails. Could be due to my ruby version being too old?

ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]

I could look into it more, but maybe we do not need to make a system call to a ruby cli at all. Instead we could just do the requests equivalent of

# substitute the owner and repo name as appropriate:
curl -i "https://api.github.com/repos/citation-file-format/cff-converter-python/license"

More about requests: https://requests.readthedocs.io/en/master/ More about github API: https://developer.github.com/v3/licenses/

I see 2 advantages of using the API with requests:

  1. We don't need to install extra things in the Dockerfile (well I guess, just requests itself)
  2. We get license validation for free, because if GitHub doesn't recognize it, we don't either.

What do you think? Worth a try?

smsaladi commented 4 years ago

Thanks -- Github uses licensee under the hood, which is how I found that project.

I think the only disadvantage of using the Github API is that the badging becomes tied to Github repos, e.g. someone would have to reimplement the license checking part if they wanted to extend to their repo on GitLab, BitBucket, other places. Would be quick to write the call + parse output of the github API though.

Not super skilled with Docker, but I can look into the ruby issue a little. I needed to install cmake and pkg-config from brew to get it going on my macos machine.

jspaaks commented 4 years ago

@smsaladi be advised the howfairis python package has moved to a new repo, see https://github.com/fair-software/badge/issues/31