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

1.0.1 #13

Closed
wants to merge 3 commits into from
Closed
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
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "release-testing",
"version": "1.0.0",
"version": "1.0.1",
"description": "Repo to test the new release flow",
"main": "index.js",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions src/ReleaseCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ export class ReleaseCreator {
draft: true
});

logger.log(`Create pull request in ${repoName}: release / ${releaseVersion} -> ${options.branch}`);
logger.log(`Create pull request in ${repoName}: release/${releaseVersion} -> ${options.branch}`);
const createResponse = await this.octokit.rest.pulls.create({
owner: this.ORG,
repo: repoName,
title: releaseVersion,
head: `release / ${releaseVersion}`,
head: `release/${releaseVersion}`,
body: `Release ${releaseVersion}`,
base: options.branch,
draft: false
Expand Down Expand Up @@ -314,7 +314,7 @@ export class ReleaseCreator {
owner: this.ORG,
repo: repoName,
state: 'open',
head: `release / ${options.releaseVersion} `
head: `release/${options.releaseVersion} `
});
if (pullRequest.data.length > 0) {
for (const pr of pullRequest.data) {
Expand All @@ -333,14 +333,14 @@ export class ReleaseCreator {
}

try {
logger.log(`Delete branch release / ${options.releaseVersion} `);
logger.log(`Delete branch release/${options.releaseVersion} `);
await this.octokit.rest.git.deleteRef({
owner: this.ORG,
repo: repoName,
ref: `heads / release / ${options.releaseVersion} `
ref: `heads/release/${options.releaseVersion} `
});
} catch (error) {
logger.log(`Failed to delete branch release / ${options.releaseVersion} `);
logger.log(`Failed to delete branch release/${options.releaseVersion} `);
}
logger.decreaseIndent();
}
Expand All @@ -362,7 +362,7 @@ export class ReleaseCreator {
private async incrementedVersion(releaseType: ReleaseType) {
const version = await this.getNewVersion(releaseType);
logger.log(`Increment version on package.json to ${version} `);
utils.executeCommand(`npm version ${version} --no - commit - hooks--no - git - tag - version`);
utils.executeCommand(`npm version ${version} --no-commit-hooks --no-git-tag-version`);

return version;
}
Expand Down
14 changes: 5 additions & 9 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ export class utils {
static verbose = true;

static executeCommand(command: string, options?: { cwd: string }) {
if (!options.cwd) {
options.cwd = process.cwd();
}
options ??= { cwd: process.cwd() };

if (!utils.verbose) {
command = `${command} > /dev/null 2>& 1`;
}
Expand All @@ -50,9 +49,7 @@ export class utils {
}

static executeCommandSucceeds(command: string, options?: { cwd: string }) {
if (!options.cwd) {
options.cwd = process.cwd();
}
options ??= { cwd: process.cwd() };

if (!utils.verbose) {
command = `${command} > /dev/null 2>& 1`;
Expand All @@ -66,9 +63,8 @@ export class utils {
}

static executeCommandWithOutput(command: string, options?: { cwd: string }) {
if (!options.cwd) {
options.cwd = process.cwd();
}
options ??= { cwd: process.cwd() };

logger.inLog(`Executing ${command}`);
return execSync(`${command} `, options).toString().trim();
}
Expand Down
Loading