Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork114
Add path filtering support for monorepo setups#1458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
caspervdw commentedJul 17, 2025
@mikepenz I tested this branch and it works as I would expect it to (using Github backend) |
@copilot rebase please |
I'm unable to perform git rebase operations as I don't have access to git push/rebase commands in this environment. You'll need to rebase this branch manually or through the GitHub interface. |
github-actionsbot commentedAug 12, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
| ||||||||||||||
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: mikepenz <1476232+mikepenz@users.noreply.github.com>
…& adjust type accordingly
…ementations- Refactored `includeOnlyPaths` handling for better consistency.- Added path filtering to `getDiffStats` and `getCommitsBetween` functions.- Updated tests to reflect changes in path filtering logic.- Enhanced offline and remote repository handling with path filtering support.
…sitory- Refactored path filtering logic for better efficiency and readability.- Consolidated file matching and commit filtering to reduce redundant API calls.- Improved handling of commit-to-file mapping.- Adjusted logic to streamline stats collection and filtering process.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR adds support for path filtering in monorepo environments by introducing anincludeOnlyPaths parameter that allows filtering commits based on the files they modify. This enables users to generate changelogs that only include commits affecting specific parts of their codebase.
- Added
includeOnlyPathsinput parameter to filter commits by file paths - Updated repository implementations to support path filtering with different strategies for GitHub and Gitea
- Added comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| action.yml | AddedincludeOnlyPaths input parameter definition |
| src/main.ts | Added input processing for path patterns with filtering logic |
| src/repositories/*.ts | Updated all repository classes to support path filtering parameter |
| src/pr-collector/*.ts | Updated data flow to pass path filtering through the collection pipeline |
| tests/pathFiltering.test.ts | Added unit tests for path filtering functionality |
| README.md | Added documentation and usage examples for monorepo configuration |
Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.
| authorName:commit.authorName, | ||
| authorDate:moment(commit.authorDate), | ||
| committer:"", | ||
| committerName:"", |
CopilotAIAug 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The committer field is hardcoded to an empty string instead of using the actual commit data. This loses information that was previously available in the original implementation.
| committerName:"", | |
| committer:commit.committer??"", | |
| committerName:commit.committerName??"", |
| authorName:commit.authorName, | ||
| authorDate:moment(commit.authorDate), | ||
| committer:"", | ||
| committerName:"", |
CopilotAIAug 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The committerName field is hardcoded to an empty string instead of using the actual commit data. This loses information that was previously available in the original implementation.
| committerName:"", | |
| committer:commit.committer, | |
| committerName:commit.committerName, |
| letchangeCount=0 | ||
| letcommitCount=0 | ||
| constpathFilteringEnabled=(includeOnlyPaths&&includeOnlyPaths.length>0)==true |
CopilotAIAug 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Using== true is redundant. The expression(includeOnlyPaths && includeOnlyPaths.length > 0) already returns a boolean.
| constpathFilteringEnabled=(includeOnlyPaths&&includeOnlyPaths.length>0)==true | |
| constpathFilteringEnabled=(includeOnlyPaths&&includeOnlyPaths.length>0) |
| commitInfo:commits | ||
| commits:filteredCommits.length, | ||
| commitInfo:filteredCommits | ||
| .filter(commit=>commit.sha) |
CopilotAIAug 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
[nitpick] The filter operationcommit => commit.sha is applied after path filtering, butcommit.sha should always be present in GitHub API responses. This filter may be unnecessary or could indicate a deeper issue.
| .filter(commit => commit.sha) |
3429301 intodevelopUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This PR adds the ability to filter commits by file paths, enabling better changelog generation for monorepo setups where different applications are stored in separate directories.
Problem
In monorepo environments, users often want to generate changelogs that only include commits affecting specific parts of the codebase. For example, when deploying
app2, they don't want to see commits that only touched files inapp1/. The GitHub API's compare endpoint doesn't support path filtering likegit log -- app1/does.Solution
Added a new optional input parameter
includeOnlyPathsthat accepts comma-separated path patterns:Implementation Details
git log -- <paths>to filter commits directly by path using local git commandsstartsWith()for flexible prefix matching (e.g.,app1/matchesapp1/src/file.js)Changes Made
includeOnlyPathsinput parameter toaction.ymlmain.tsand parameter passing through the call chainOptionsinterface and repository classes to support path filteringGithubRepositoryandGiteaRepositoryTesting
Added unit tests covering:
Existing tests continue to pass, ensuring backward compatibility.
Fixes#1457.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
gitea.com/usr/local/bin/node /home/REDACTED/work/release-changelog-builder-action/release-changelog-builder-action/node_modules/jest-worker/build/workers/processChild.js(dns block)https://api.github.com/graphql/usr/local/bin/node /home/REDACTED/work/release-changelog-builder-action/release-changelog-builder-action/node_modules/jest-worker/build/workers/processChild.js(http block)https://api.github.com/repos/mikepenz/release-changelog-builder-action-playground/compare/1.5.0...2.0.0/usr/local/bin/node /home/REDACTED/work/release-changelog-builder-action/release-changelog-builder-action/node_modules/jest-worker/build/workers/processChild.js(http block)https://api.github.com/repos/mikepenz/release-changelog-builder-action-playground/compare/2.0.0...3.0.0-a01/usr/local/bin/node /home/REDACTED/work/release-changelog-builder-action/release-changelog-builder-action/node_modules/jest-worker/build/workers/processChild.js(http block)https://api.github.com/repos/mikepenz/release-changelog-builder-action-playground/compare/2.0.0...3.0.1/usr/local/bin/node /home/REDACTED/work/release-changelog-builder-action/release-changelog-builder-action/node_modules/jest-worker/build/workers/processChild.js(http block)https://api.github.com/repos/mikepenz/release-changelog-builder-action-playground/releases/tags/1.5.0/usr/local/bin/node /home/REDACTED/work/release-changelog-builder-action/release-changelog-builder-action/node_modules/jest-worker/build/workers/processChild.js(http block)https://api.github.com/repos/mikepenz/release-changelog-builder-action-playground/releases/tags/2.0.0/usr/local/bin/node /home/REDACTED/work/release-changelog-builder-action/release-changelog-builder-action/node_modules/jest-worker/build/workers/processChild.js(http block)https://api.github.com/repos/mikepenz/release-changelog-builder-action-playground/releases/tags/3.0.0-a01/usr/local/bin/node /home/REDACTED/work/release-changelog-builder-action/release-changelog-builder-action/node_modules/jest-worker/build/workers/processChild.js(http block)https://api.github.com/repos/mikepenz/release-changelog-builder-action-playground/releases/tags/3.0.1/usr/local/bin/node /home/REDACTED/work/release-changelog-builder-action/release-changelog-builder-action/node_modules/jest-worker/build/workers/processChild.js(http block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.