Skip to content

Commit

Permalink
Don't run snyk on forks
Browse files Browse the repository at this point in the history
Signed-off-by: Iliya Savov <[email protected]>
  • Loading branch information
isavov committed Apr 20, 2023
1 parent 5930069 commit 6d58b9b
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/comp-compile-pbj-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,13 @@ jobs:
- name: Gradle Snyk Test (PBJ Core)
id: gradle-snyk-test
uses: gradle/gradle-build-action@v2
if: ${{ inputs.enable-snyk-scan && !cancelled() && always()}}
if: >-
${{
inputs.enable-snyk-scan &&
github.event.pull_request.head.repo.full_name == github.repository &&
always() &&
!cancelled()
}}
with:
gradle-version: ${{ inputs.gradle-version }}
build-root-directory: ${{ env.PBJ_CORE }}
Expand All @@ -201,7 +207,13 @@ jobs:
- name: Gradle Snyk Code Test (PBJ Core)
id: gradle-snyk-code
uses: gradle/gradle-build-action@v2
if: ${{ inputs.enable-snyk-scan && !cancelled() && always()}}
if: >-
${{
inputs.enable-snyk-scan &&
github.event.pull_request.head.repo.full_name == github.repository &&
always() &&
!cancelled()
}}
with:
gradle-version: ${{ inputs.gradle-version }}
build-root-directory: ${{ env.PBJ_CORE }}
Expand All @@ -214,7 +226,13 @@ jobs:
run: npm install -g snyk-to-html @wcj/html-to-markdown-cli

- name: Publish Snyk Results
if: ${{ inputs.enable-snyk-scan && !cancelled() && always()}}
if: >-
${{
inputs.enable-snyk-scan &&
github.event.pull_request.head.repo.full_name == github.repository &&
always() &&
!cancelled()
}}
run: |
snyk-to-html -i build/reports/snyk-test.json -o build/reports/snyk-test.html && \
html-to-markdown build/reports/snyk-test.html -o build/reports/snyk && \
Expand Down

0 comments on commit 6d58b9b

Please sign in to comment.