Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@
"singleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "avoid"
"arrowParens": "avoid",
"overrides": [{
"files": "src/bump/sdkver.ts",
"options": {
"printWidth": 120
}
}]
}
13 changes: 12 additions & 1 deletion bump/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,22 @@ inputs:
version-prefix:
description: 'Optional version prefix (eg. "", "v", "componentX-"). If set, only tags with this exact prefix shall be considered. "*" is a special value, meaning the closest version is used, regardless of prefix".'
required: false
increment-type-override:
description: >-
Optional override for the type of version increment to apply for this build.
If not set, the action will determine the increment type based on the commits since the last tag.
One of ["major", "minor", "patch"]
default: ""
required: false
release-type:
description: >-
The type of version increment to apply for this build when using the SdkVer version scheme.
This has no effect when using the SemVer version scheme.
This has no effect when using the SemVer version scheme.
One of ["rel", "rc", "dev"] [EXPERIMENTAL]

To ensure a breaking change in SdkVer, either use a conventional commit with a breaking change,
or set the `increment-type-override` to `major`. Other values of `increment-type-override`
will be ignored.
default: ""
required: false
create-changelog:
Expand Down
1,023 changes: 579 additions & 444 deletions dist/bump/index.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion dist/cli/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

616 changes: 175 additions & 441 deletions dist/validate/index.js

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions src/actions/bump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
import * as core from "@actions/core";

import { context } from "@actions/github";
import { bumpSdkVer } from "../bump/sdkver";
import {
bumpSdkVer,
bumpSemVer,
getVersionBumpTypeAndMessages,
printNonCompliance,
} from "../bump";
} from "../bump/semver";
import { Configuration } from "../config";
import { getConfig } from "../github";
import {
Expand All @@ -31,6 +31,7 @@ import {
SdkVerBumpType,
IVersionOutput,
} from "../interfaces";
import { SemVerType } from "../semver";

/**
* Bump action entrypoint
Expand Down Expand Up @@ -59,6 +60,7 @@ export async function run(): Promise<void> {
}
const release = core.getBooleanInput("create-release");
const tag = core.getBooleanInput("create-tag");

let releaseMode: ReleaseMode = "none";
if (release) {
releaseMode = "release";
Expand All @@ -77,6 +79,22 @@ export async function run(): Promise<void> {
const bumpInfo: IVersionBumpTypeAndMessages =
await getVersionBumpTypeAndMessages(context.sha, config);

let incrementTypeOverride = core.getInput("increment-type-override");
if (incrementTypeOverride) {
if (
Object.keys(SemVerType).includes(incrementTypeOverride.toUpperCase())
) {
bumpInfo.requiredBump =
SemVerType[
incrementTypeOverride.toUpperCase() as keyof typeof SemVerType
];
} else {
core.warning(
`The input 'increment-type-override' must be one of: [major, minor, patch]. Using default behavior.`
);
}
}

if (!bumpInfo.foundVersion) {
// We haven't found a (matching) SemVer tag in the commit and tag list
core.setOutput("current-version", "");
Expand Down
2 changes: 1 addition & 1 deletion src/actions/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

import * as core from "@actions/core";
import { getVersionBumpType } from "../bump";
import { ConventionalCommitMessage } from "../commit";

import { Configuration } from "../config";
Expand All @@ -27,6 +26,7 @@ import {
validatePrTitle,
validatePrTitleBump,
} from "../validate";
import { getVersionBumpType } from "../bump/semver";

/**
* Determine labels to add based on the provided conventional commits
Expand Down
Loading
Loading