From b1786e6aeed2a01950b32529b55cda1771f6e8c9 Mon Sep 17 00:00:00 2001 From: Francois Marier Date: Tue, 14 May 2024 17:32:29 -0700 Subject: [PATCH] Move license-related hotwords to a rule --- action.yml | 4 ---- assets/semgrep_rules/client/licensing.html | 17 +++++++++++++++++ assets/semgrep_rules/client/licensing.txt | 4 ++++ assets/semgrep_rules/client/licensing.yaml | 9 +++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 assets/semgrep_rules/client/licensing.html create mode 100644 assets/semgrep_rules/client/licensing.txt create mode 100644 assets/semgrep_rules/client/licensing.yaml diff --git a/action.yml b/action.yml index 55d3b279..1673a4c2 100644 --- a/action.yml +++ b/action.yml @@ -40,10 +40,6 @@ inputs: urlparse :disableDigestUpdates pinDigest - NonCommercial - NoDerivs - BY-NC - BY-ND debug: description: enables debug output for this action required: false diff --git a/assets/semgrep_rules/client/licensing.html b/assets/semgrep_rules/client/licensing.html new file mode 100644 index 00000000..092726cd --- /dev/null +++ b/assets/semgrep_rules/client/licensing.html @@ -0,0 +1,17 @@ +

+ + The following JavaScript library + + by + + John Doe + + is licensed under + + // ruleid: license-nonfree + CC BY-NC 4.0 + + + + +

diff --git a/assets/semgrep_rules/client/licensing.txt b/assets/semgrep_rules/client/licensing.txt new file mode 100644 index 00000000..2117749c --- /dev/null +++ b/assets/semgrep_rules/client/licensing.txt @@ -0,0 +1,4 @@ +// ruleid: license-nonfree +This logo is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license. + +See LICENSE.txt for more details. diff --git a/assets/semgrep_rules/client/licensing.yaml b/assets/semgrep_rules/client/licensing.yaml new file mode 100644 index 00000000..bd4c7920 --- /dev/null +++ b/assets/semgrep_rules/client/licensing.yaml @@ -0,0 +1,9 @@ +rules: + - id: license-nonfree + message: "Non-free license detected" + severity: ERROR + languages: + - regex + patterns: + # ruleid: license-nonfree + - pattern-regex: (NonCommercial|NoDerivs|BY-NC|BY-ND)