From 73907db856fb468383d5be06bf20148e6ab8ebeb Mon Sep 17 00:00:00 2001 From: Pepe Fagoaga Date: Fri, 27 Mar 2026 07:37:19 +0000 Subject: [PATCH] fix(trivy-scan): don't comment if PR from fork (#10490) --- .github/actions/trivy-scan/action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/trivy-scan/action.yml b/.github/actions/trivy-scan/action.yml index 9360dd0953..9073e2fbcb 100644 --- a/.github/actions/trivy-scan/action.yml +++ b/.github/actions/trivy-scan/action.yml @@ -117,7 +117,10 @@ runs: INPUTS_IMAGE_TAG: ${{ inputs.image-tag }} - name: Comment scan results on PR - if: inputs.create-pr-comment == 'true' && github.event_name == 'pull_request' + if: >- + inputs.create-pr-comment == 'true' + && github.event_name == 'pull_request' + && github.event.pull_request.head.repo.full_name == github.repository uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: IMAGE_NAME: ${{ inputs.image-name }}