2023-07-14 21:56:21 +00:00
|
|
|
name: govulncheck
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 12 * * *" # 8am EST / 10am PST / 12pm UTC
|
|
|
|
workflow_dispatch: # allow manual trigger for testing
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- ".github/workflows/govulncheck.yml"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
source-scan:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out code into the Go module directory
|
2024-09-23 20:52:19 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2023-07-14 21:56:21 +00:00
|
|
|
|
|
|
|
- name: Install govulncheck
|
|
|
|
run: ./tool/go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
|
|
|
|
|
|
- name: Scan source code for known vulnerabilities
|
|
|
|
run: PATH=$PWD/tool/:$PATH "$(./tool/go env GOPATH)/bin/govulncheck" -test ./...
|
|
|
|
|
2024-01-09 19:51:08 +00:00
|
|
|
- name: Post to slack
|
|
|
|
if: failure() && github.event_name == 'schedule'
|
2024-09-23 22:11:13 +00:00
|
|
|
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
|
2024-01-09 19:51:08 +00:00
|
|
|
env:
|
|
|
|
SLACK_BOT_TOKEN: ${{ secrets.GOVULNCHECK_BOT_TOKEN }}
|
2023-07-14 21:56:21 +00:00
|
|
|
with:
|
2024-01-09 19:51:08 +00:00
|
|
|
channel-id: 'C05PXRM304B'
|
|
|
|
payload: |
|
2023-07-14 21:56:21 +00:00
|
|
|
{
|
2024-01-09 19:51:08 +00:00
|
|
|
"blocks": [
|
|
|
|
{
|
|
|
|
"type": "section",
|
|
|
|
"text": {
|
|
|
|
"type": "mrkdwn",
|
|
|
|
"text": "Govulncheck failed in ${{ github.repository }}"
|
|
|
|
},
|
|
|
|
"accessory": {
|
|
|
|
"type": "button",
|
|
|
|
"text": {
|
|
|
|
"type": "plain_text",
|
|
|
|
"text": "View results"
|
|
|
|
},
|
|
|
|
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2023-07-14 21:56:21 +00:00
|
|
|
}
|