Skip to content

feat(go-pr-analysis): let callers gate on govulncheck instead of only logging it - #947

Merged
bedatty merged 1 commit into
developfrom
feat/govulncheck-opt-in-gate
Oct 20, 2026
Merged

bedatty merged 1 commit into
developfrom
feat/govulncheck-opt-in-gate

Conversation

@bedatty

@bedatty bedatty commented Oct 20, 2026

Copy link
Copy Markdown
Contributor
Lerian

GitHub Actions Shared Workflows


Description

go-pr-analysis.yml ran govulncheck with a bare continue-on-error: true. A known vulnerability in a consumer's dependency graph therefore left the Security job green, and the finding stayed in a job log nobody opens on a passing check — every Go repository on the channel read "security passed" without proof that it had.

Removing the flag outright would be a break for every consumer at once. The Go vulnerability database moves independently of the pull request, so the day a reachable CVE lands in a common dependency, every repository on the channel goes red on pull requests that touch nothing related — the same shape of breakage x/vuln v1.8.0 already caused here, as the govulncheck_version input description records.

So the step branches on the exit code instead of swallowing it:

  • New fail_on_govulncheck input (boolean, default: false) in go-pr-analysis.yml, forwarded by go-pr-validation.yml.
  • false (today's behaviour): the job still passes, but the finding is now emitted as a ::warning:: annotation instead of being buried in the log.
  • true: the finding is emitted as ::error:: and the Security job fails, which propagates through checks_passed to the Go Analysis gate.

A repository opts into the gate once its dependency graph is clean, which is the sequence the issue asks for — run the analysis against the consumers and fix or accept what it reports before flipping anything globally.

Out of scope, deliberately: make sec / gosec -no-fail in the same job and the Trivy exit-code: '0' in pr-security-scan.yml remain advisory, and the default here stays false. Flipping the channel-wide default is a separate, evidence-backed decision.

Type of Change

  • feat: New workflow or new input/output/step in an existing workflow
  • fix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)
  • perf: Performance improvement (e.g. caching, parallelism, reduced steps)
  • refactor: Internal restructuring with no behavior change
  • docs: Documentation only (README, docs/, inline comments)
  • ci: Changes to self-CI (workflows under .github/workflows/ that run on this repo)
  • chore: Dependency bumps, config updates, maintenance
  • test: Adding or updating tests
  • BREAKING CHANGE: Callers must update their configuration after this PR

Breaking Changes

None. fail_on_govulncheck defaults to false, which is exactly the pass/fail behaviour the step had before. The only observable difference for a caller that changes nothing is a warning annotation where there was previously silence.

Testing

  • YAML syntax validated locally
  • Triggered a real workflow run on a caller repository using @this-branch or the beta tag
  • Verified all existing inputs still work with default values
  • Confirmed no secrets or tokens are printed in logs
  • Checked that unrelated workflows are not affected

actionlint clean on both modified workflows. The caller-side value is fail_on_govulncheck: true on a repository with a known finding; this PR's own self-CI exercises the default path.

Caller repo / workflow run:

Related Issues

Closes #910

… logging it

The "Run govulncheck" step carried a bare `continue-on-error: true`, so a known
vulnerability in a consumer's dependency graph left the Security job green and
the finding sat in a job log nobody opens on a passing check.

Removing the flag outright would be a break for every repository on the channel:
the Go vulnerability database moves independently of the pull request, so a newly
published CVE in a common dependency would turn them all red at once, on pull
requests touching nothing related — the same shape of breakage x/vuln v1.8.0
already caused here.

So the step now branches on the exit code instead. Findings are always annotated:
a warning by default, an error — failing the job — when the new
`fail_on_govulncheck` input is true. The default keeps today's behaviour, and a
repository that has cleaned its graph can opt into the gate on its own schedule.

Closes #910
@bedatty
bedatty requested a review from a team as a code owner October 20, 2026 18:56
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LerianStudio/github-actions-shared-workflows/.coderabbit.yml
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: ff1a2796-5b72-4b58-9757-cc9aa6aa89a9
📥 Commits

Reviewing files that changed from the base of the PR and between 9583c80 and 17fbca7.

📒 Files selected for processing: 4
  • .github/workflows/go-pr-analysis.yml
  • .github/workflows/go-pr-validation.yml
  • docs/go-pr-analysis.md
  • docs/go-pr-validation.md

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Walkthrough

The Go analysis and validation workflows add a fail_on_govulncheck input, defaulting to false. Govulncheck findings produce warnings by default. When enabled, findings produce errors and fail the Security job.

Changes

govulncheck enforcement

Layer / File(s) Summary
Define and forward the failure input
.github/workflows/go-pr-analysis.yml, .github/workflows/go-pr-validation.yml, docs/go-pr-analysis.md, docs/go-pr-validation.md
The workflows define fail_on_govulncheck with a default of false. The validation workflow forwards the input to the reusable analysis workflow. The documentation describes the input.
Handle govulncheck results
.github/workflows/go-pr-analysis.yml, docs/go-pr-analysis.md
The analysis workflow emits a warning and succeeds when findings occur and the input is disabled. When enabled, findings produce an error and fail the Security job. The documentation describes this behavior.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature · Severity of issue fixed: Medium

Suggested reviewers: fredcamaral

Merge Risk: ⚪ Minimal · up to 17fbc

The configurable failure behavior is mergeable after normal checks. An incomplete scan can produce a misleading findings warning in the default mode, but this change does not newly allow that scan error to pass the Security job.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: allowing callers to make govulncheck findings fail the workflow instead of only logging them.
Description check Passed The description follows the required template, explains the behavior change and compatibility impact, identifies testing performed, and links the change to issue #910. It clearly states that no real c…
Linked Issues check Passed Issue #910 requires govulncheck findings to be able to fail CI instead of being hidden by continue-on-error: true. The PR adds fail_on_govulncheck to both reusable workflows, forwards the input, r…
Out of Scope Changes check Passed The changes are limited to the two Go reusable workflow interfaces, govulncheck result handling, and documentation for the new input. These changes directly implement issue #910. The documented adviso…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Description check

Explanation

The description follows the required template, explains the behavior change and compatibility impact, identifies testing performed, and links the change to issue #910. It clearly states that no real caller workflow run was completed.

Full details: Linked Issues check

Explanation

Issue #910 requires govulncheck findings to be able to fail CI instead of being hidden by continue-on-error: true. The PR adds fail_on_govulncheck to both reusable workflows, forwards the input, reports findings as warnings when false, and reports errors that fail the Security job when true. The default remains false, which preserves compatibility while providing the requested opt-in gate. The PR also reports YAML and actionlint validation.

Full details: Out of Scope Changes check

Explanation

The changes are limited to the two Go reusable workflow interfaces, govulncheck result handling, and documentation for the new input. These changes directly implement issue #910. The documented advisory behavior for GoSec and Trivy remains unchanged. No unrelated change is demonstrated.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (4 skipped: 4 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@lerian-studio lerian-studio added size/XS PR changes < 50 lines documentation Improvements or additions to documentation workflow Changes to one or more reusable workflow files golang Changes to Go-related workflows validate Changes to PR validation composite actions (src/validate/) labels Oct 20, 2026
@lerian-studio

Copy link
Copy Markdown
Contributor

🔍 PR Validation Summary

✅ PR Mergeable — no blocking failures

Check Status Blocking
Source Branch ✅ success yes
PR Title ✅ success yes
PR Description ✅ success yes
Breaking Change Guard ✅ success yes
Commit Signatures ✅ success yes
PR Size ✅ success no
Auto Labels ✅ success no
PR Metadata ✅ success no

🔍 View workflow run

@lerian-studio

Copy link
Copy Markdown
Contributor

🔍 Lint Analysis

Check Files Scanned Status
YAML Lint 2 file(s) ✅ success
Action Lint 2 file(s) ✅ success
Pinned Actions 2 file(s) ✅ success
Markdown Link Check 2 file(s) ✅ success
Spelling Check 4 file(s) ✅ success
Shell Check 2 file(s) ✅ success
README Check 2 file(s) ✅ success
Composite Schema no changes ⏭️ skipped
Deployment Matrix no changes ⏭️ skipped

🔍 View full scan logs

@lerian-studio

Copy link
Copy Markdown
Contributor

🛡️ CodeQL Analysis Results

Languages analyzed: actions

✅ No security issues found.


🔍 View full scan logs | 🛡️ Security tab

@lerian-studio

Copy link
Copy Markdown
Contributor

@coderabbitai review

@lerian-studio lerian-studio added the review-ready Required checks passed — CodeRabbit is cleared to review label Oct 20, 2026
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bedatty
bedatty merged commit b29605d into develop Oct 20, 2026
44 checks passed
@github-actions
github-actions Bot deleted the feat/govulncheck-opt-in-gate branch October 20, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation golang Changes to Go-related workflows review-ready Required checks passed — CodeRabbit is cleared to review size/XS PR changes < 50 lines validate Changes to PR validation composite actions (src/validate/) workflow Changes to one or more reusable workflow files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

go-pr-analysis: govulncheck runs with continue-on-error, so findings never fail CI

2 participants