feat: skip per-package monorepo release tags in container builds#20
Merged
warengonzaga merged 2 commits intomainfrom Feb 22, 2026
Merged
feat: skip per-package monorepo release tags in container builds#20warengonzaga merged 2 commits intomainfrom
warengonzaga merged 2 commits intomainfrom
Conversation
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix redundant container builds in monorepo release
feat: skip per-package monorepo release tags in container builds
Feb 22, 2026
There was a problem hiding this comment.
Pull request overview
This PR adds the ability to skip container builds for monorepo per-package release tags by introducing a configurable release tag pattern filter. When a release tag doesn't match the expected pattern (e.g., @scope/pkg@1.0.0 vs v1.0.0), the workflow exits early with a new "skip" flow type, preventing redundant builds and wasted CI resources.
Changes:
- Adds
release-tag-patterninput with a default semver regex pattern - Implements early-exit skip logic in the build flow detection script
- Updates all post-detect workflow steps with skip conditions
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| action.yml | Adds new release-tag-pattern input under Monorepo Configuration section, updates build-flow-type output to include "skip" and source from detect step, adds skip conditions to 19 workflow steps |
| scripts/detect-build-flow.sh | Adds pattern matching logic for release tags, implements early-exit skip flow with minimal outputs when tags don't match pattern |
Comments suppressed due to low confidence (2)
scripts/detect-build-flow.sh:49
- The Flow Types documentation in the header should include the new 'skip' flow type that was added in this PR. Add a line like: " - skip : Release tag doesn't match pattern (monorepo per-package tags)"
RELEASE_TAG_PATTERN="${RELEASE_TAG_PATTERN-^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$}"
action.yml:245
- The short-sha output still references steps.output.outputs.short-sha but should reference steps.detect.outputs.short-sha for consistency. When the build flow is 'skip', the output step (id: output) doesn't run, but short-sha is still set by the detect step and should be accessible.
description: 'Detected build flow type (pr, dev, patch, staging, wip, release, skip)'
value: ${{ steps.detect.outputs.build-flow-type }}
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.
In monorepos using per-package releases (e.g.,
@scope/pkg@1.0.0), the container workflow fires for every package release — not just the root/unified release — causing redundant builds, broken image tags, and wasted CI minutes.Changes
New input:
release-tag-patternaction.ymlunder a new Monorepo Configuration section^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$(full semver)'') to allow all release tags unconditionallydetect-build-flow.shRELEASE_TAG_PATTERNenv var (uses-not:-so empty string correctly disables filtering)flow_type=skip, logs the reason, writes minimal outputs, and returns early — no tag generation, no Docker operationsaction.ymlstep conditionssteps.detect.outputs.build-flow-type != 'skip': Buildx setup, registry logins, metadata extraction, build/push, all Trivy scans, SARIF uploads, and PR commentsbuild-flow-typeoutputsteps.output(which is skipped) tosteps.detectso callers always get the actual value, includingskipskipas a valid flow typeOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.