-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add example to make gradle-jdk17 action compatible with actions/set-up-java #109
Conversation
Snyk actions that execute Java commands are not compatible with the official
Two ways to fix this issue that come to my mind are:
|
Incompatible example: steps:
- name: Set up Java
uses: actions/setup-java@v3 # Exports JAVA_HOME variable incompatible with Snyk actions (value=/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.4-1/x64)
with:
java-version: 17
distribution: temurin
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.3
# Run your Gradle commands
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/gradle-jdk17@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=high Action error:
Compatible example enforcing expected - name: Run Snyk to check for vulnerabilities
uses: snyk/actions/gradle-jdk17@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
JAVA_HOME: /opt/java/openjdk # Enforce directory expected by the Snyk container
with:
args: --severity-threshold=high |
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.
Hey @ibaiul , thanks for the contribution! Would you please sign your commit and force-push? Unfortunately, we can only accept signed commits (see https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
…set up Java action
Sure, that makes total sense. I have signed and re-pushed the commit. |
I have created this example pull request as I was not able to find a way to report this incompatibility issue in another way.
I believe this issue affects all Snyk actions that execute Java commands but I have only provided an example for the Gradle JDK17 Snyk action waiting for some feedback on how to tackle the incompatibility issue.