Repository navigation
ci: run Go jobs only when code changes - #7
Closed
bahram-bahrambeigy-cdt wants to merge 1 commit into
Closed
bahram-bahrambeigy-cdt wants to merge 1 commit into
bahram-bahrambeigy-cdt wants to merge 1 commit into
Conversation
Doc, example and config-only PRs were spinning up a full OpenMetadata stack for nothing. Gate lint, build and acceptance on a changed-paths job instead. Uses a job-level if, not a workflow paths filter: a path-filtered required check never reports and blocks the PR forever, while a skipped job counts as passing. The detection fails open — manual runs, a missing base sha, or a failed diff all run the full suite. Also passes the workflow_dispatch version input through env rather than interpolating it into the shell. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Superseded by the simpler path-filter approach. Closing in favour of the six-line version. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Doc, example and config-only PRs were starting a full OpenMetadata stack (MySQL + Elasticsearch + OM server, ~3 min) to prove nothing.
lint,buildandAcceptance Testsnow run only when the change can affect them.Why not a
paths:filterAll four checks are required by branch protection. A workflow skipped by a
paths:filter never reports its check, so the PR sits at "Expected — waiting for status" and can never merge. A job skipped by anif:condition reports as passing. So the gate is achangesjob whose output the other jobs read.What still runs on every PR
Every resource has an acceptance test— 6 seconds, and it is a structural invariant worth enforcing on every changechangesjob itselfFails open
Manual
workflow_dispatch, a missing or zeroed base sha (new branch, force push), or a failed diff all returncode=trueand run everything. A change that cannot be classified is treated as code.Paths that count as code:
internal/,tools/,main.go,go.mod,go.sum,.golangci.yml,docker/test/,scripts/testacc.sh, and.github/workflows/plus the script itself — so a workflow edit always proves itself.Also
The
workflow_dispatchversion input now reachessedthroughenv:instead of being interpolated into the shell. It needs write access to set, so it was not an outsider risk, but it was an injection point.Verified the classifier against real commit ranges and a table of representative paths: source, build and workflow files run; README,
docs/,examples/,AGENTS.md,dependabot.ymland the PR template skip.🤖 Generated with Claude Code