Go Security Scan #244
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: Go Security Scan | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - '**.go' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - '.github/workflows/go-security.yml' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - '**.go' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - '.github/workflows/go-security.yml' | |
| schedule: | |
| - cron: '0 14 * * 3' # Run once a week on Wednesday at 14:00 UTC | |
| jobs: | |
| security-scan: | |
| name: Security Scan with gosec | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Run gosec Security Scanner | |
| uses: securego/gosec@v2.23.0 | |
| with: | |
| args: '-no-fail -fmt sarif -out results.sarif ./...' | |
| - name: Upload gosec scan results to GitHub Security tab | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: results.sarif | |
| if: always() # Upload results even if gosec finds issues |