Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate --major --minor --patch flags #100

Merged
merged 2 commits into from
Dec 18, 2018
Merged
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
3 changes: 0 additions & 3 deletions docs/pages/auto-pr-check.md
Original file line number Diff line number Diff line change
@@ -16,9 +16,6 @@ Options
--pr number [required] The pull request number you want the labels of
--url string URL to associate with this status
--onlyPublishWithReleaseLabel Only bump version if 'release' label is on pull request
--major string The name of the tag for a major version bump
--minor string The name of the tag for a minor version bump
--patch string The name of the tag for a patch version bump
--context string A string label to differentiate this status from others
--noReleaseLabels string[] Labels that will not create a release. Defaults to just 'no-release'

3 changes: 0 additions & 3 deletions docs/pages/auto-version.md
Original file line number Diff line number Diff line change
@@ -8,9 +8,6 @@ Get the semantic version bump for the given changes. Requires all PRs to have la
Options

--onlyPublishWithReleaseLabel Only bump version if 'release' label is on pull request
--major string The name of the tag for a major version bump
--minor string The name of the tag for a minor version bump
--patch string The name of the tag for a patch version bump
--noReleaseLabels string[] Labels that will not create a release. Defaults to just 'no-release'

Global Options
30 changes: 2 additions & 28 deletions src/cli/args.ts
Original file line number Diff line number Diff line change
@@ -121,29 +121,6 @@ const onlyPublishWithReleaseLabel: commandLineUsage.OptionDefinition = {
group: 'main'
};

const major: commandLineUsage.OptionDefinition = {
name: 'major',
type: String,
description: 'The name of the tag for a major version bump',
group: 'main'
};

const minor: commandLineUsage.OptionDefinition = {
name: 'minor',
type: String,
description: 'The name of the tag for a minor version bump',
group: 'main'
};

const patch: commandLineUsage.OptionDefinition = {
name: 'patch',
type: String,
description: 'The name of the tag for a patch version bump',
group: 'main'
};

const semver = [onlyPublishWithReleaseLabel, major, minor, patch];

const name: commandLineUsage.OptionDefinition = {
name: 'name',
type: String,
@@ -224,7 +201,7 @@ const commands: ICommand[] = [
options: [
pr,
url,
...semver,
onlyPublishWithReleaseLabel,
{
...context,
defaultValue: 'ci/pr-check'
@@ -278,7 +255,7 @@ const commands: ICommand[] = [
{
name: 'version',
summary: 'Get the semantic version bump for the given changes.',
options: [...semver, noReleaseLabels, ...defaultOptions],
options: [onlyPublishWithReleaseLabel, noReleaseLabels, ...defaultOptions],
examples: [
{
desc: 'Get the new version using the last release to head',
@@ -546,9 +523,6 @@ export default function parseArgs(testArgs?: string[]) {
export interface ISemverArgs {
noReleaseLabels?: string[];
onlyPublishWithReleaseLabel?: boolean;
major?: string;
minor?: string;
patch?: string;
jira?: string;
slack?: string;
githubApi?: string;
7 changes: 0 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -212,13 +212,6 @@ export async function run(args: ArgsType) {

verbose.success('Loaded `auto-release` with config:', rawConfig);

Object.entries(args).forEach(([key, val]) => {
// tslint:disable-next-line
if (val === null) {
delete (args as any)[key];
}
});

const config: IGithubReleaseOptions = {
...rawConfig,
...args,