Merged
Conversation
8782cb5 to
9723d7a
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for an ignoredBranches input to allow skipping specified branches when determining the next branch name. Key changes include wiring the new input through the Inputs class and action metadata, extending the Branch logic to filter out ignored branches, and expanding test coverage with various ignore scenarios.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main.ts | Pass ignoredBranches into the Branch constructor |
| src/inputs.ts | Parse and store the ignoredBranches action input |
| src/branch.ts | Extend branch selection methods to skip ignored names |
| get-next-branch/action.yml | Add ignoredBranches input definition |
| action.yml | Add ignoredBranches input definition |
| tests/inputs.test.ts | Update tests to assert ignoredBranches parsing |
| tests/branch.test.ts | Add and adjust test cases covering ignore behavior |
Comments suppressed due to low confidence (1)
tests/branch.test.ts:286
- [nitpick] There's a noted TODO for handling cases where all branches of the next major version are ignored. Consider adding a test and implementing fallback logic to cover this scenario once the behavior is defined.
// TODO: The following test fails as we don't try stable branches for future major versions
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.
This PR adds support for the
ignoredBranchesinput. This input takes a a list of ignored branch names as a JSON string. When getting candidates for the next branch name, any ignored branch is skipped until finding a non-skipped branch name. The tests contain examples for this.Due to the way next branch candidates are computed, skipping the entirety of a major version leads to an unexpected result. Instead of targeting the first stable version of the major version after a skipped major, it targets the next dev branch of that major version. See the commented test for the expected behaviour. Fixing this would require changing how candidate branches are computed, and since this scenario is currently not needed by us, I'll wait with making the change.