Skip to content

chore(ci): govulncheck will only fail if PR adds a new vulnerability - #7405

Merged
electron0zero merged 2 commits into
grafana:mainfrom
electron0zero:govulncheck-pr-diff-gate
Jun 4, 2026
Merged

chore(ci): govulncheck will only fail if PR adds a new vulnerability#7405
electron0zero merged 2 commits into
grafana:mainfrom
electron0zero:govulncheck-pr-diff-gate

Conversation

@electron0zero

@electron0zero electron0zero commented Jun 4, 2026

Copy link
Copy Markdown
Member

What this PR does:

Adds a govulncheck workflow that fails a PR only for reachable vulnerabilities the PR newly introduces, replacing the previous absolute scan in ci.yml. It scans the PR head and the base branch and diffs the results, so a CVE already present in main shows up in both scans and is filtered out, so it doesn't fail the check.

Checklist

  • Tests updated
  • Documentation added
  • Changelog entry added under .chloggen/ (N/A - CI-only change, chore: title skips the changelog gate)
Adds a govulncheck workflow that fails a PR only for reachable
vulnerabilities the PR newly introduces, replacing the previous absolute
scan in ci.yml. It scans the PR head and the base branch and diffs the
results, so a CVE already present in main shows up in both scans and is
filtered out, so it doesn't fail the check.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a dedicated govulncheck PR workflow that compares reachable vulnerability findings between the PR (merge ref) and the base branch, and removes the previous always-on govulncheck job from the main CI workflow to avoid failing PRs on pre-existing vulns in main.

Changes:

  • Introduces a new govulncheck.yml workflow that scans both PR and base and fails only if the PR introduces new reachable vulnerabilities.
  • Removes the previous golang/govulncheck-action job from ci.yml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/govulncheck.yml New PR gate workflow that diffs govulncheck results between PR and base.
.github/workflows/ci.yml Removes the old govulncheck job now replaced by the dedicated workflow.
Comment thread .github/workflows/govulncheck.yml
Comment thread .github/workflows/govulncheck.yml
Comment thread .github/workflows/govulncheck.yml Outdated
@electron0zero
electron0zero force-pushed the govulncheck-pr-diff-gate branch from 789d51e to 58e0469 Compare June 4, 2026 15:35
Copilot AI review requested due to automatic review settings June 4, 2026 15:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

Comment thread .github/workflows/govulncheck.yml Outdated
Comment thread .github/workflows/govulncheck.yml Outdated
Comment thread .github/workflows/govulncheck.yml
Comment thread .github/workflows/govulncheck.yml
@electron0zero
electron0zero force-pushed the govulncheck-pr-diff-gate branch from 58e0469 to 67d5d0f Compare June 4, 2026 15:41
@electron0zero electron0zero changed the title chore(ci): add govulncheck PR diff gate Jun 4, 2026
Copilot AI review requested due to automatic review settings June 4, 2026 15:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 15 changed files in this pull request and generated 1 comment.

Comment thread go.mod
@electron0zero
electron0zero force-pushed the govulncheck-pr-diff-gate branch from 1142335 to 67d5d0f Compare June 4, 2026 15:57

@mattdurham mattdurham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@electron0zero
electron0zero enabled auto-merge (squash) June 4, 2026 16:05
@electron0zero
electron0zero merged commit e761da7 into grafana:main Jun 4, 2026
52 of 62 checks passed
@electron0zero
electron0zero deleted the govulncheck-pr-diff-gate branch June 4, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants