Security Vulnerability Check #245
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: Security Vulnerability Check | |
| on: | |
| push: | |
| branches-ignore: | |
| - renovate/** | |
| paths: | |
| - "**.go" | |
| - "go.mod" | |
| - "go.sum" | |
| - ".golangci.yaml" | |
| - ".github/workflows/security.yaml" | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - "**.go" | |
| - "go.mod" | |
| - "go.sum" | |
| - ".github/workflows/security.yaml" | |
| schedule: | |
| - cron: "15 3 * * 4" | |
| env: | |
| GOTOOLCHAIN: "local" | |
| jobs: | |
| vulnerability-scan: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - uses: trim21/actions/setup-go@master | |
| - run: go run golang.org/x/vuln/cmd/govulncheck ./... | |
| - name: Notify failed build | |
| uses: jayqi/failed-build-issue-action@v1.2.0 | |
| if: "failure() && github.event_name != 'pull_request'" | |
| with: | |
| github-token: ${{ github.token }} | |
| label-name: vulncheck | |
| - name: Close resolved vulnerability issues | |
| if: success() | |
| uses: actions/github-script@v8.0.0 | |
| with: | |
| github-token: ${{ github.token }} | |
| script: | | |
| const label = 'vulncheck'; | |
| const { owner, repo } = context.repo; | |
| const issues = await github.paginate( | |
| github.rest.issues.listForRepo, | |
| { owner, repo, labels: label, state: 'open', per_page: 100 } | |
| ); | |
| for (const issue of issues) { | |
| await github.rest.issues.update({ owner, repo, issue_number: issue.number, state: 'closed' }); | |
| } |