Support resharing and performance optimization #1
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: Gosec Security Scan | |
| on: | |
| push: | |
| branches: [ main, master, develop ] | |
| pull_request: | |
| branches: [ main, master, develop ] | |
| schedule: | |
| # Run every day at 3 AM UTC | |
| - cron: '0 3 * * *' | |
| permissions: | |
| contents: read | |
| security-events: write | |
| jobs: | |
| gosec: | |
| runs-on: ubuntu-latest | |
| env: | |
| GO111MODULE: on | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23' | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Download Go modules | |
| run: go mod download | |
| - name: Install Gosec | |
| run: go install github.com/securego/gosec/v2/cmd/gosec@latest | |
| - name: Run Gosec Security Scanner | |
| run: | | |
| gosec -config .gosec.json -fmt sarif -out results.sarif -stdout ./... | |
| - name: Upload SARIF file | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: results.sarif | |
| - name: Generate Text Report | |
| run: | | |
| gosec -config .gosec.json -fmt text -out gosec-report.txt ./... | |
| - name: Upload Report Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gosec-security-report | |
| path: | | |
| results.sarif | |
| gosec-report.txt |