Run Gosec Security Scan #64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Gosec Security Scan | |
| on: | |
| push: | |
| branches: ["*"] | |
| pull_request: | |
| branches: ["*"] | |
| schedule: | |
| - cron: "25 5 * * 6" # Weekly on Saturdays at 5:25 AM | |
| workflow_dispatch: | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| jobs: | |
| gosec: | |
| name: Run gosec | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Run gosec via action | |
| uses: securego/gosec@master | |
| with: | |
| args: -fmt sarif -out gosec.sarif ./... | |
| continue-on-error: true | |
| timeout-minutes: 15 | |
| - name: Check SARIF file | |
| id: check_sarif | |
| run: | | |
| if [ -f gosec.sarif ]; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Upload sarif | |
| if: steps.check_sarif.outputs.exists == 'true' | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: gosec.sarif |