mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2025-12-27 04:58:17 +00:00
Use input branch name instead of GitHub environment variable for generating release link
This commit is contained in:
parent
e4de6a96b5
commit
bedbb2c292
2 changed files with 8 additions and 10 deletions
9
dist/index.js
vendored
9
dist/index.js
vendored
|
|
@ -654,7 +654,7 @@ const cmd = async (command, ...args) => {
|
|||
return output;
|
||||
};
|
||||
|
||||
const setOutput = (major, minor, patch, increment, changed) => {
|
||||
const setOutput = (major, minor, patch, increment, changed, branch) => {
|
||||
const format = core.getInput('format', { required: true });
|
||||
var version = format
|
||||
.replace('${major}', major)
|
||||
|
|
@ -665,11 +665,10 @@ const setOutput = (major, minor, patch, increment, changed) => {
|
|||
const tag = tagPrefix + version;
|
||||
|
||||
const repository = process.env.GITHUB_REPOSITORY;
|
||||
const branch = process.env.GITHUB_REF;
|
||||
|
||||
core.info(`Version is ${major}.${minor}.${patch}+${increment}`);
|
||||
if (repository !== undefined) {
|
||||
core.info(`To create a release for this version, go to https://github.com/${repository}/releases/new?tag=${tag}&target=${branch}`);
|
||||
core.info(`To create a release for this version, go to https://github.com/${repository}/releases/new?tag=${tag}&target=${branch.trim()}`);
|
||||
}
|
||||
core.setOutput("version", version);
|
||||
core.setOutput("major", major.toString());
|
||||
|
|
@ -699,7 +698,7 @@ async function run() {
|
|||
|
||||
if (lastCommitAll === '') {
|
||||
// empty repo
|
||||
setOutput('0', '0', '0', '0', changed);
|
||||
setOutput('0', '0', '0', '0', changed, branch);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -784,7 +783,7 @@ async function run() {
|
|||
patch++;
|
||||
}
|
||||
|
||||
setOutput(major, minor, patch, increment, changed);
|
||||
setOutput(major, minor, patch, increment, changed, branch);
|
||||
|
||||
} catch (error) {
|
||||
core.error(error);
|
||||
|
|
|
|||
9
index.js
9
index.js
|
|
@ -18,7 +18,7 @@ const cmd = async (command, ...args) => {
|
|||
return output;
|
||||
};
|
||||
|
||||
const setOutput = (major, minor, patch, increment, changed) => {
|
||||
const setOutput = (major, minor, patch, increment, changed, branch) => {
|
||||
const format = core.getInput('format', { required: true });
|
||||
var version = format
|
||||
.replace('${major}', major)
|
||||
|
|
@ -29,11 +29,10 @@ const setOutput = (major, minor, patch, increment, changed) => {
|
|||
const tag = tagPrefix + version;
|
||||
|
||||
const repository = process.env.GITHUB_REPOSITORY;
|
||||
const branch = process.env.GITHUB_REF;
|
||||
|
||||
core.info(`Version is ${major}.${minor}.${patch}+${increment}`);
|
||||
if (repository !== undefined) {
|
||||
core.info(`To create a release for this version, go to https://github.com/${repository}/releases/new?tag=${tag}&target=${branch}`);
|
||||
core.info(`To create a release for this version, go to https://github.com/${repository}/releases/new?tag=${tag}&target=${branch.trim()}`);
|
||||
}
|
||||
core.setOutput("version", version);
|
||||
core.setOutput("major", major.toString());
|
||||
|
|
@ -63,7 +62,7 @@ async function run() {
|
|||
|
||||
if (lastCommitAll === '') {
|
||||
// empty repo
|
||||
setOutput('0', '0', '0', '0', changed);
|
||||
setOutput('0', '0', '0', '0', changed, branch);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +147,7 @@ async function run() {
|
|||
patch++;
|
||||
}
|
||||
|
||||
setOutput(major, minor, patch, increment, changed);
|
||||
setOutput(major, minor, patch, increment, changed, branch);
|
||||
|
||||
} catch (error) {
|
||||
core.error(error);
|
||||
|
|
|
|||
Loading…
Reference in a new issue