mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2025-12-27 13:08:17 +00:00
Output release link to log
This commit is contained in:
parent
71e429646c
commit
709e271b17
2 changed files with 20 additions and 4 deletions
12
dist/index.js
vendored
12
dist/index.js
vendored
|
|
@ -638,6 +638,8 @@ const core = __webpack_require__(470);
|
||||||
const exec = __webpack_require__(986);
|
const exec = __webpack_require__(986);
|
||||||
const eol = __webpack_require__(87).EOL;
|
const eol = __webpack_require__(87).EOL;
|
||||||
|
|
||||||
|
const tagPrefix = core.getInput('tag_prefix') || '';
|
||||||
|
|
||||||
const cmd = async (command, ...args) => {
|
const cmd = async (command, ...args) => {
|
||||||
let output = '';
|
let output = '';
|
||||||
const options = {
|
const options = {
|
||||||
|
|
@ -660,8 +662,15 @@ const setOutput = (major, minor, patch, increment, changed) => {
|
||||||
.replace('${patch}', patch)
|
.replace('${patch}', patch)
|
||||||
.replace('${increment}', increment);
|
.replace('${increment}', increment);
|
||||||
|
|
||||||
|
const tag = tagPrefix + version;
|
||||||
|
|
||||||
|
const repository = process.env.GITHUB_REPOSITORY;
|
||||||
|
const branch = process.env.GITHUB_REF;
|
||||||
|
|
||||||
core.info(`Version is ${major}.${minor}.${patch}+${increment}`);
|
core.info(`Version is ${major}.${minor}.${patch}+${increment}`);
|
||||||
core.info(`To create a release for this `)
|
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.setOutput("version", version);
|
core.setOutput("version", version);
|
||||||
core.setOutput("major", major.toString());
|
core.setOutput("major", major.toString());
|
||||||
core.setOutput("minor", minor.toString());
|
core.setOutput("minor", minor.toString());
|
||||||
|
|
@ -676,7 +685,6 @@ async function run() {
|
||||||
const remoteExists = remote !== '';
|
const remoteExists = remote !== '';
|
||||||
const remotePrefix = remoteExists ? 'origin/' : '';
|
const remotePrefix = remoteExists ? 'origin/' : '';
|
||||||
|
|
||||||
const tagPrefix = core.getInput('tag_prefix') || '';
|
|
||||||
const branch = `${remotePrefix}${core.getInput('branch', { required: true })}`;
|
const branch = `${remotePrefix}${core.getInput('branch', { required: true })}`;
|
||||||
const majorPattern = core.getInput('major_pattern', { required: true });
|
const majorPattern = core.getInput('major_pattern', { required: true });
|
||||||
const minorPattern = core.getInput('minor_pattern', { required: true });
|
const minorPattern = core.getInput('minor_pattern', { required: true });
|
||||||
|
|
|
||||||
12
index.js
12
index.js
|
|
@ -2,6 +2,8 @@ const core = require('@actions/core');
|
||||||
const exec = require("@actions/exec");
|
const exec = require("@actions/exec");
|
||||||
const eol = require('os').EOL;
|
const eol = require('os').EOL;
|
||||||
|
|
||||||
|
const tagPrefix = core.getInput('tag_prefix') || '';
|
||||||
|
|
||||||
const cmd = async (command, ...args) => {
|
const cmd = async (command, ...args) => {
|
||||||
let output = '';
|
let output = '';
|
||||||
const options = {
|
const options = {
|
||||||
|
|
@ -24,8 +26,15 @@ const setOutput = (major, minor, patch, increment, changed) => {
|
||||||
.replace('${patch}', patch)
|
.replace('${patch}', patch)
|
||||||
.replace('${increment}', increment);
|
.replace('${increment}', increment);
|
||||||
|
|
||||||
|
const tag = tagPrefix + version;
|
||||||
|
|
||||||
|
const repository = process.env.GITHUB_REPOSITORY;
|
||||||
|
const branch = process.env.GITHUB_REF;
|
||||||
|
|
||||||
core.info(`Version is ${major}.${minor}.${patch}+${increment}`);
|
core.info(`Version is ${major}.${minor}.${patch}+${increment}`);
|
||||||
core.info(`To create a release for this `)
|
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.setOutput("version", version);
|
core.setOutput("version", version);
|
||||||
core.setOutput("major", major.toString());
|
core.setOutput("major", major.toString());
|
||||||
core.setOutput("minor", minor.toString());
|
core.setOutput("minor", minor.toString());
|
||||||
|
|
@ -40,7 +49,6 @@ async function run() {
|
||||||
const remoteExists = remote !== '';
|
const remoteExists = remote !== '';
|
||||||
const remotePrefix = remoteExists ? 'origin/' : '';
|
const remotePrefix = remoteExists ? 'origin/' : '';
|
||||||
|
|
||||||
const tagPrefix = core.getInput('tag_prefix') || '';
|
|
||||||
const branch = `${remotePrefix}${core.getInput('branch', { required: true })}`;
|
const branch = `${remotePrefix}${core.getInput('branch', { required: true })}`;
|
||||||
const majorPattern = core.getInput('major_pattern', { required: true });
|
const majorPattern = core.getInput('major_pattern', { required: true });
|
||||||
const minorPattern = core.getInput('minor_pattern', { required: true });
|
const minorPattern = core.getInput('minor_pattern', { required: true });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue