-
Notifications
You must be signed in to change notification settings - Fork 14
Prevents the use of actions/setup-java@v1 and adopt /adopt-hotspot (openjdk) distributions. #82
Conversation
…on/setup-java@v1 since it doesn't support eclipse temurin distributions.
…opt-hotspot distributions on the actions/setup-java@v2+, since such distributions won't be supported anymore.
@OriYosef Is there a way to test the new rules? The |
pkg/rulesConfig/defaultRules/github/12-prevent-action-setup-java-v1.json
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,7 @@ | |||
{ | |||
"description": "Prevent use of action/setup-java@v1.", | |||
"failureMessage": "action/setup-java@v1 is used on the workflow.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the failureMessage
here as well
pkg/rulesConfig/defaultRules/gitlab/13-prevent-adopt-distributions-on-setup-java.json
Outdated
Show resolved
Hide resolved
pkg/rulesConfig/defaultRules/github/13-prevent-adopt-distributions-on-setup-java.json
Outdated
Show resolved
Hide resolved
pkg/rulesConfig/defaultRules/github/13-prevent-adopt-distributions-on-setup-java.json
Outdated
Show resolved
Hide resolved
Hey @jmj0502 . Thank you again for your contribution! |
I'm working on it 😬 |
@OriYosef Excellent! I'll be working on the changes. Ok, no problem. I'll use the JSON schema validator as you said! Glad somebody is working on the testing feature c: that will help a lot in the future! |
…ng if the action/setup-java@v2+ is used before checking for the use of adopt/adopt-hotspot distributions.
@OriYosef I've already made changes. Now the When you have some time, would you please take a look at the |
"description": "Prevent use of action/setup-java@v1.", | ||
"failureMessage": "action/setup-java@v1 is used on the workflow. action/setup-java@v1 uses a java distribution that is out of support (AdoptOpenJDK) by default, please use action/setup-java@v2+ and avoid the use of adopt/adopt-host distributions.", | ||
"uniqueId": 12, | ||
"enableByDefault": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo:
enabledByDefault
please fix in all files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! OMW
}, | ||
"then": { | ||
"properties": { | ||
"uses": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format of the if condition looks good. The only thing is that the distribution
key is given in the with
section. please see this example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okok! I'll work on the change. Should I access the contents of with
using properties
or additionalProperties
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkout this example.
@jmj0502 |
… reference to the distribution property on the rule allero-io#13.
@OriYosef I already worked on the review comments! When it comes to the |
Yes, You can see the link I sent before. |
@OriYosef Cool! I reviewed the content of the link, but I wasn't sure if the Thanks for all the guidance! Definitely looking forward to keeping on making contributions. |
@jmj0502 |
Solves #26
prevent-action-setup-java-v1
rule. It prevents the use of the actionsetup-java@v1
, since it doesn't allow uses to specify the distribution they'll use.prevent-adopt-distributions-on-setup-java
rule. It prevents the use ofadopt/adopt-hotspot
distributions since such distributions won't be supported anymore.