-
Notifications
You must be signed in to change notification settings - Fork 101
[CI/CD] Add govulncheck to CI #1416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sean-breen
wants to merge
13
commits into
main
Choose a base branch
from
add-govulncheck
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+79
−0
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9b85fa7
[skip ci] add govulncheck workflow
sean-breen 1a275bf
add vulncheck workflow, call from CI.yml, and allow dispatch
sean-breen 4e78539
Merge branch 'main' into add-govulncheck
sean-breen 98646fd
Merge branch 'main' into add-govulncheck
sean-breen 15fd67a
add nightly-scans.yml workflow
sean-breen 09c490e
checkout
sean-breen 1e4ca59
checkout via ref name
sean-breen 606f521
fix calling workflow
sean-breen ad75c40
fix startup failure
sean-breen 31552f3
Add missing permission for security_events
sean-breen 1cb2926
add check for go version in go.mod
sean-breen 3536ae4
fix setting of output from go version step
sean-breen 73b02e8
use toolchain version
sean-breen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: nightly-scans.yml | ||
| on: | ||
| schedule: | ||
| - cron: '0 2 * * *' # Runs daily at 2:00 AM UTC | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| scan-main: | ||
| name: Vulnerability Scan - Main | ||
| uses: ./.github/workflows/vulncheck.yml | ||
| with: | ||
| target-branch: 'main' | ||
|
|
||
| scan-v2: | ||
| name: Vulnerability Scan - dev-v2 | ||
| uses: ./.github/workflows/vulncheck.yml | ||
| with: | ||
| target-branch: 'dev-v2' |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: vulncheck.yaml | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| go-version-input: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the go-version-input inputs be removed now? |
||
| description: 'Go version to install' | ||
| type: string | ||
| required: false | ||
| default: '1.24.10' | ||
| target-branch: | ||
| description: 'Target branch to run govulncheck against' | ||
| type: string | ||
| required: false | ||
| default: 'main' | ||
| workflow_dispatch: | ||
| inputs: | ||
| go-version-input: | ||
| description: 'Go version to install' | ||
| required: false | ||
| default: '1.24.10' | ||
| target-branch: | ||
| description: 'Target branch to run govulncheck against' | ||
| required: false | ||
| default: 'main' | ||
|
|
||
| jobs: | ||
| vulncheck: | ||
| name: Vulnerability Check | ||
| runs-on: ubuntu-22.04 | ||
| permissions: | ||
| security-events: write # for reporting vulnerabilities via code-scanning API | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ inputs.targetBranch || 'main' }} | ||
|
|
||
| - name: Check Go version | ||
| id: get-go-version | ||
| run: | | ||
| echo "Reading from go.mod" | ||
| GO_VERSION=$(grep -E "^toolchain " go.mod | awk -F' ' '{print $2}' | tr -d 'go') | ||
| echo "Found $GO_VERSION" | ||
| echo "go-version="$GO_VERSION"" >> $GITHUB_OUTPUT | ||
| - name: Run govulncheck | ||
| id: govulncheck | ||
| uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4 | ||
| with: | ||
| go-version-input: ${{ steps.get-go-version.outputs.go-version }} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to get the golang version from the go.mod file like how we do it for the setup-go action on line 72?