From e83c48db73cc8badadda6305b7a0c390a782c682 Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Tue, 3 Sep 2024 13:34:52 +0530 Subject: [PATCH] Fix the Workflows --- .github/workflows/govulncheck.yml | 7 +------ .github/workflows/semgrep.yml | 10 ++-------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index 88823078..edc53fbd 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -19,15 +19,10 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha || github.ref }} - - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} - name: Scan for Vulnerabilities in Code (Internal PR) + - name: Scan for Vulnerabilities in Code uses: golang/govulncheck-action@dd0578b371c987f96d1185abb54344b44352bd58 # pin@1.0.3 with: go-version-file: go.mod go-package: ./... check-latest: true repo-checkout: false - - - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - name: Skip Vulnerability Scan (External PR) - run: echo "Skipping vulnerability scan for external PRs" diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml index e2e79c13..6321013d 100644 --- a/.github/workflows/semgrep.yml +++ b/.github/workflows/semgrep.yml @@ -1,7 +1,6 @@ name: Semgrep on: - merge_group: pull_request: types: - opened @@ -28,19 +27,14 @@ jobs: steps: - if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group' - run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection. + run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. - name: Checkout Code uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha || github.ref }} - - if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} - name: Run Semgrep for internal PRs + - name: Run Semgrep run: semgrep ci env: SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_TOKEN }} - - - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - name: Skip Semgrep for external PRs - run: echo "Skipping Semgrep for external PRs as secrets are not available"