This commit is contained in:
Matthew Bryce 2025-10-15 06:47:14 -04:00 committed by GitHub
commit 7b7f7da5fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 3 deletions

View file

@ -88,7 +88,7 @@ If you are not able to provide a test case, it is still very helpful to provide
## Forking the Project
If want to do something that does not fit with the project goals, particually if you want to include information from an outside system, it is probably best to fork the project and create your own action. One of the goals of this project starting in 5.0.0 is to be easy to fork and customize, and to that end the action has been broken into individual providers than can be replaced. All providers have been implemented using async calls specifically to support calls to external systems.
If want to do something that does not fit with the project goals, particularly if you want to include information from an outside system, it is probably best to fork the project and create your own action. One of the goals of this project starting in 5.0.0 is to be easy to fork and customize, and to that end the action has been broken into individual providers than can be replaced. All providers have been implemented using async calls specifically to support calls to external systems.
The steps of this action are:
@ -98,7 +98,7 @@ The steps of this action are:
- Classify the release
Additionally a few formatter provide modular behavior to these step:
- A tag formmater is used to parse and format the version number
- A tag formatter is used to parse and format the version number
- A version formatter is used to format output version string
- A user formatter is used to format the user information in the output (JSON and CSV are provided in the default implementation)

View file

@ -1144,3 +1144,35 @@ test('Prerelease mode does not increment to 1.x.x', async () => {
expect(result.formattedVersion).toBe('1.1.0-prerelease.1');
expect(result.isTagged).toBe(true);
}, timeout);
test('Versioning from branch always ignores major commit pattern', async () => {
const repo = createTestRepo({
versionFromBranch: true,
majorPattern: "(MAJOR)"
});
repo.makeCommit('Initial Commit');
repo.exec("git checkout -b release/v3.2");
repo.makeCommit(`(MAJOR) Second Commit`);
const result = await repo.runAction();
expect(result.formattedVersion).toBe('3.2.1+1');
}, timeout);
test('Versioning from branch always ignores minor commit pattern', async () => {
const repo = createTestRepo({
versionFromBranch: true,
minorPattern: "(MINOR)"
});
repo.makeCommit('Initial Commit');
repo.exec("git checkout -b release/v3.2");
repo.makeCommit(`(MINOR) Second Commit`);
const result = await repo.runAction();
expect(result.formattedVersion).toBe('3.2.1+1');
}, timeout);