Add example to make gradle-jdk17 action compatible with actions/set-up-java#109
Add example to make gradle-jdk17 action compatible with actions/set-up-java#109bastiandoetsch merged 1 commit intosnyk:masterfrom
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=highAction 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 |
bastiandoetsch
left a comment
There was a problem hiding this comment.
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.