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

Implement a LICENSE rule type #1419

Merged
merged 2 commits into from
Nov 3, 2023
Merged

Conversation

rdimitrov
Copy link
Member

@rdimitrov rdimitrov commented Nov 3, 2023

The following rule type allows for:

  • Ensuring only the presence of a LICENSE file (when license_type = "" is left blank)
---
# Sample profile for validating the presence of a license file
version: v1
type: profile
name: license
context:
  provider: github
repository:
  - type: license
    def:
      license_filename: LICENSE
      license_type: ""
  • Ensuring the present LICENSE file contains a given license type, i.e. Apache.
---
# Sample profile for validating the presence of a license file and its type
version: v1
type: profile
name: license
context:
  provider: github
repository:
  - type: license
    def:
      license_filename: LICENSE
      license_type: "Apache"
  • The file name of the license is not hardcoded to allow for flexibility
  • The licence type check just verifies if the configured keyword is present in the license file. It doesn't ensure that the legal content in that file matches the configured license type.

Motivated by the discussion in #1413 (comment)

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
@rdimitrov rdimitrov self-assigned this Nov 3, 2023
@rdimitrov rdimitrov mentioned this pull request Nov 3, 2023
@rdimitrov rdimitrov added the enhancement New feature or request label Nov 3, 2023
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
@eryn-muetzel
Copy link
Contributor

@rdimitrov it would be better to have someone in engineering review this PR

@JAORMX JAORMX merged commit a70d65c into mindersec:main Nov 3, 2023
12 checks passed
@JAORMX JAORMX deleted the license-ruletype branch November 3, 2023 06:02
@rdimitrov
Copy link
Member Author

@rdimitrov it would be better to have someone in engineering review this PR

yeah, I added you just so you are aware of the functionality 👍

@evankanderson evankanderson mentioned this pull request Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants