Skip to content

feat: add optional paths filter for workflow triggers#181

Merged
hoegertn merged 6 commits intomainfrom
claude/add-workflow-path-conditions-BJeLT
Mar 27, 2026
Merged

feat: add optional paths filter for workflow triggers#181
hoegertn merged 6 commits intomainfrom
claude/add-workflow-path-conditions-BJeLT

Conversation

@hoegertn
Copy link
Copy Markdown
Contributor

Summary

  • Adds an optional paths property to CDKPipelineOptions for monorepo support
  • When set, workflows only trigger when files matching the specified path patterns are changed
  • GitHub: Applied as on.push.paths and on.pull_request_target.paths filters on deploy, deploy-feature, and destroy-feature workflows
  • GitLab: Applied as only.changes filters on diff and deploy jobs

Usage

new GithubCDKPipeline(app, {
  paths: ['packages/my-app/**', 'shared-libs/**'],
  // ... other options
});

Test plan

  • Added snapshot tests for GitHub with path filters
  • Added snapshot tests for GitHub with path filters + feature stages
  • Added snapshot tests for GitLab with path filters
  • All 175 tests pass

https://claude.ai/code/session_01AtVACTAtsYim11BFCTjyNE

Support path-based filtering for monorepo setups where workflows should
only run when files in specific subproject paths are changed.

- Add `paths` option to CDKPipelineOptions
- GitHub: applies as `on.push.paths` and `on.pull_request_target.paths`
- GitLab: applies as `only.changes` on deployment jobs

https://claude.ai/code/session_01AtVACTAtsYim11BFCTjyNE
@github-actions github-actions bot requested a review from Lock128 March 25, 2026 19:20
github-actions bot and others added 2 commits March 25, 2026 19:21
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@hoegertn hoegertn enabled auto-merge March 25, 2026 23:03
Lock128
Lock128 previously approved these changes Mar 27, 2026
Copy link
Copy Markdown
Contributor

@Lock128 Lock128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…#182)

- Adds a `pipelineName` option to `CDKPipelineOptions` and
`DriftDetectionWorkflowOptions` that acts as a namespace prefix for all
repo-global identifiers (workflow files, artifact names, concurrency
groups, and GitLab job names)
- When a project has a parent (monorepo subproject), `pipelineName`
defaults to the project name; for standalone projects, no prefix is
applied — fully backward compatible
- Prefixes are applied consistently across GitHub workflows, GitLab CI
jobs, artifact names, and concurrency groups in all pipeline types
(GitHub, GitLab) and drift detection workflows

- [x] All 172 existing tests pass with no snapshot changes, confirming
backward compatibility for standalone projects
- [ ] Verify in a monorepo setup that two subprojects generate distinct
workflow files (e.g. `backend-deploy.yml` and `frontend-deploy.yml`)
- [ ] Verify `pipelineName` can be explicitly overridden to a custom
value
- [ ] Verify GitLab CI job names are correctly prefixed and
cross-references (needs/extends) are consistent

https://claude.ai/code/session_01BLsobs9698wX9PPEBx6wBK

---------

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@hoegertn hoegertn disabled auto-merge March 27, 2026 08:35
@hoegertn hoegertn merged commit b0191d8 into main Mar 27, 2026
8 checks passed
@hoegertn hoegertn deleted the claude/add-workflow-path-conditions-BJeLT branch March 27, 2026 08:35
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.

3 participants