Skip to content

Commit

Permalink
Move license-related hotwords to a rule
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarier authored and thypon committed May 15, 2024
1 parent 0fdb730 commit b1786e6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
4 changes: 0 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ inputs:
urlparse
:disableDigestUpdates
pinDigest
NonCommercial
NoDerivs
BY-NC
BY-ND
debug:
description: enables debug output for this action
required: false
Expand Down
17 changes: 17 additions & 0 deletions assets/semgrep_rules/client/licensing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/">
<a property="dct:title" rel="cc:attributionURL" href="https://example.com">
The following JavaScript library
</a>
by
<a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://john.example.com">
John Doe
</a>
is licensed under
<a href="https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">
// ruleid: license-nonfree
CC BY-NC 4.0
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt="">
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt="">
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1" alt="">
</a>
</p>
4 changes: 4 additions & 0 deletions assets/semgrep_rules/client/licensing.txt
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 9 additions & 0 deletions assets/semgrep_rules/client/licensing.yaml
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit b1786e6

Please sign in to comment.