Skip to content

ci: scope validate matrix to changed components only - #28

Merged
opariffazman merged 1 commit into
mainfrom
ci/scope-validate-matrix-changed-components
Jun 30, 2026
Merged

opariffazman merged 1 commit into
mainfrom
ci/scope-validate-matrix-changed-components

Conversation

@opariffazman

Copy link
Copy Markdown
Contributor

Summary

Extend the discover job 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

  • Added — new component or feature (MINOR)
  • Changed — behavior change to an existing component
  • Fixed — bug fix (PATCH)
  • Removed
  • Breaking input/output change — callers must edit their config (MAJOR; flag loudly in CHANGELOG)

Changes

  • discover checkout gains fetch-depth: 0 so git diff can reach the base SHA
  • list step detects changed components via git diff; falls back to all when .tflint.hcl, .terraform-version, or ci.yml change, or when no valid base SHA exists (force-push, initial push)
  • validate gains if: needs.discover.outputs.components != '[]' to skip cleanly when no Terraform files changed
  • docs, precommit-coverage, and other workflows are untouched

Validation

  • terraform fmt / validate / tflint pass on the changed components (the gate)
  • Commit subjects are consumer-facing, type(scope): subject with scope = component (the CHANGELOG is generated from them at release time — preview in the PR's changelog comment)
  • Component README / root README updated if inputs or outputs changed

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>
@opariffazman
opariffazman requested a review from Lexxick as a code owner June 30, 2026 06:58
@github-actions

Copy link
Copy Markdown

📝 Changelog preview

Generated from this branch's Conventional Commits — this is what the next vX.Y.Z tag publishes verbatim to CHANGELOG.md and the GitHub Release (no manual curation). Tighten an entry by tightening its commit subject; scope it to the component.

[Unreleased]

Fixed

  • Added tag & untag instance profile perms

@opariffazman
opariffazman merged commit 04e9a06 into main Jun 30, 2026
14 checks passed
@opariffazman
opariffazman deleted the ci/scope-validate-matrix-changed-components branch June 30, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant