govulncheck.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. name: govulncheck
  2. on:
  3. schedule:
  4. - cron: "0 12 * * *" # 8am EST / 10am PST / 12pm UTC
  5. workflow_dispatch: # allow manual trigger for testing
  6. pull_request:
  7. paths:
  8. - ".github/workflows/govulncheck.yml"
  9. jobs:
  10. source-scan:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Check out code into the Go module directory
  14. uses: actions/checkout@v4
  15. - name: Install govulncheck
  16. run: ./tool/go install golang.org/x/vuln/cmd/govulncheck@latest
  17. - name: Scan source code for known vulnerabilities
  18. run: PATH=$PWD/tool/:$PATH "$(./tool/go env GOPATH)/bin/govulncheck" -test ./...
  19. - uses: ruby/[email protected]
  20. with:
  21. payload: >
  22. {
  23. "attachments": [{
  24. "title": "${{ job.status }}: ${{ github.workflow }}",
  25. "title_link": "https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks",
  26. "text": "${{ github.repository }}@${{ github.sha }}",
  27. "color": "danger"
  28. }]
  29. }
  30. env:
  31. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  32. if: failure() && github.event_name == 'schedule'