Skip to content

Skip unchanged images on PR builds#44

Open
mrdavidlaing wants to merge 2 commits into
mainfrom
skip-unchanged-images-on-pr-builds
Open

Skip unchanged images on PR builds#44
mrdavidlaing wants to merge 2 commits into
mainfrom
skip-unchanged-images-on-pr-builds

Conversation

@mrdavidlaing

Copy link
Copy Markdown
Contributor

Summary

  • Add paths field to each entry in .github/image-matrix.json mapping images to their source files
  • Rewrite load-matrix job in build.yml to filter the matrix by PR changed files (via GitHub API)
  • Always rebuild all images when flake.nix, flake.lock, common/lib/, common/pkgs/, or workflow files change
  • Upload filtered matrix as artifact so the SBOM quality gate only scores images that were actually built
  • Strip paths field in pre-release and cleanup workflows (which always process all images)

Test plan

  • Open a PR that only changes common/images/redis.nix — verify only redis image builds
  • Open a PR that changes flake.lock — verify all 7 images build
  • Open a PR that changes apps/sbomify/deployments/compose/Caddyfile.dev — verify only sbomify-caddy-dev builds
  • Verify SBOM quality gate correctly downloads the filtered matrix and only scores built images
  • Run workflow_dispatch manually — verify all images build

🤖 Generated with Claude Code

The load-matrix job now filters the build matrix by comparing PR changed
files against each image's declared source paths. Single-image PRs only
build the affected image; flake/common/workflow changes still trigger a
full rebuild of all images.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Mar 31, 2026

Copy link
Copy Markdown

SBOM Quality Gate

Image Score Baseline Delta Status

@mrdavidlaing mrdavidlaing force-pushed the skip-unchanged-images-on-pr-builds branch from c8c13c2 to 81aceb2 Compare March 31, 2026 20:51
Move the inline changed-file detection and matrix filtering logic from
build.yml into common/lib/scripts/filter-build-matrix with ShellSpec
tests, following the existing script+test pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

SBOM Quality Gate

Image Score Baseline Delta Status

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