Skip to content

Commit

Permalink
ci: use native paths instead of get-diff-action (#13342)
Browse files Browse the repository at this point in the history
* ci: use native paths instead of get-diff-action

* ci: add paths for pr
  • Loading branch information
pratikbin authored Sep 20, 2022
1 parent c1c23a7 commit 14c0233
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: Run Gosec
on:
pull_request:
paths:
- '**/*.go'
- 'go.mod'
- 'go.sum'
push:
branches:
- main
paths:
- '**/*.go'
- 'go.mod'
- 'go.sum'

jobs:
Gosec:
Expand All @@ -16,22 +24,15 @@ jobs:
steps:
- name: Checkout Source
uses: actions/checkout@v3
- name: Get Diff
uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
**/*.go
go.mod
go.sum

- name: Run Gosec Security Scanner
uses: cosmos/gosec@master
with:
# we let the report trigger content trigger a failure using the GitHub Security features.
args: "-no-fail -fmt sarif -out results.sarif ./..."
if: "env.GIT_DIFF_FILTERED != ''"

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif
if: "env.GIT_DIFF_FILTERED != ''"

0 comments on commit 14c0233

Please sign in to comment.