Skip to content

fix(go-pr-validation): gate jobs pass when changes job fails #419

Closed

Description

@bedatty

Description

If the changes job in go-pr-validation.yml fails (e.g. GitHub API error in the non-doc-changes composite), the downstream go-analysis, security, and lib-version jobs are all skipped. Their corresponding *-gate jobs receive result: skipped, which result-gate treats as success — so the required checks all go green even though we don't know whether code changed.

Affected code

go-pr-validation.yml — go-analysis-gate, security-gate, lib-version-gate:

- name: Aggregate Go Analysis result
  uses: LerianStudio/github-actions-shared-workflows/src/validate/result-gate@v1
  with:
    result: ${{ needs.go-analysis.result }}   # 'skipped' when changes fails → gate passes

Fix

Propagate changes.result into each gate when it is not success:

result: ${{ needs.changes.result != 'success' && needs.changes.result || needs.go-analysis.result }}

Apply the same pattern to security-gate and lib-version-gate.

This preserves the intended skip-on-docs-only behavior (when changes succeeds and sets code=false, the pipeline jobs are skipped and gates pass as designed) while failing the gates when changes itself errors out.

Priority

Low — changes failing is rare (transient GitHub API issue). The failure is visible in the workflow run even without this fix.

Metadata

Metadata

Assignees

Labels

bugSomething is not working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions