Skip to content

Commit

Permalink
Use separate sonarcloud.yaml
Browse files Browse the repository at this point in the history
This follows the convention from our other repos.
Also, ignore Gosec failures.

Signed-off-by: Dale Haiducek <[email protected]>
  • Loading branch information
dhaiducek authored and openshift-merge-bot[bot] committed Dec 6, 2023
1 parent ed64c43 commit 81c2fe2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/gosec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: GoSec scan

on:
push:
branches:
- master
- release-[0-9]+.[0-9]+
pull_request:
branches:
- master
- release-[0-9]+.[0-9]+

jobs:
gosec:
runs-on: ubuntu-latest
steps:
- name: Checkout Gatekeeper
uses: actions/checkout@v4
- name: Run Gosec Security Scanner
uses: securego/[email protected]
with:
args: -no-fail -fmt sonarqube -out gosec.json -stdout -exclude-dir=.go -exclude-dir=test ./...
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: gosec.json
30 changes: 5 additions & 25 deletions .github/workflows/sonarcloud.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
name: Sonarcloud scan

on:
push:
branches:
- master
- release-[0-9]+.[0-9]+
pull_request:
branches:
- master
- release-[0-9]+.[0-9]+
workflow_run:
workflows:
- GoSec scan
types:
- completed

jobs:
gosec:
runs-on: ubuntu-latest
name: GoSec Scan
steps:
- name: Checkout Gatekeeper
uses: actions/checkout@v4
- name: Run Gosec Security Scanner
uses: securego/[email protected]
with:
args: -fmt sonarqube -out gosec.json -stdout -exclude-dir=.go -exclude-dir=test ./...
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: gosec.json

sonarcloud:
needs: [ gosec ]
uses: stolostron/governance-policy-framework/.github/workflows/sonarcloud.yml@main
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 comments on commit 81c2fe2

Please sign in to comment.