Skip to content

ci: skip the changes job's full-history clone when the diff is never read #385

Backlog

Description

@jflowers

The changes job in .github/workflows/test.yml and .github/workflows/mega-linter.yml sets fetch-depth: 0 unconditionally, while the classify step reads history only on pull_request events — every push run pays a full-history clone for a diff the script never computes, and every ordinary code PR waits on that clone before the heavy jobs start.

Severity: LOW (efficiency; bounded by timeout-minutes: 5).

Location: .github/workflows/test.yml:34 (byte-identical job duplicated in mega-linter.yml).

Suggested fix: gate the checkout with if: github.event_name == 'pull_request', or use a shallower fetch that still reaches the merge-base, in both workflows.

Source: review feedback on PR #373 — #373 (comment) (divisor-sre, council review).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions