Repository navigation
ci: scope validate matrix to changed components only - #28
Merged
Merged
Conversation
On PR and push to main, discover now emits only the component dirs that contain changed .tf/.tofu/.tfvars files rather than all 8 every time. Falls back to the full list when shared config (.tflint.hcl, .terraform-version, ci.yml) changes or when no valid base SHA is available (force-push, initial push). An empty matrix short-circuits the validate job cleanly via an if: condition. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📝 Changelog previewGenerated from this branch's Conventional Commits — this is what the next [Unreleased]Fixed
|
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.
Summary
Extend the
discoverjob to emit only the component dirs that contain changed Terraform files, rather than all 8 on every run. Falls back to the full list when shared config changes or when no valid base SHA is available.Component(s)
ci
Type
Changes
discovercheckout gainsfetch-depth: 0sogit diffcan reach the base SHAliststep detects changed components viagit diff; falls back to all when.tflint.hcl,.terraform-version, orci.ymlchange, or when no valid base SHA exists (force-push, initial push)validategainsif: needs.discover.outputs.components != '[]'to skip cleanly when no Terraform files changeddocs,precommit-coverage, and other workflows are untouchedValidation
terraform fmt/validate/tflintpass on the changed components (the gate)type(scope): subjectwith scope = component (the CHANGELOG is generated from them at release time — preview in the PR's changelog comment)