Skip to content

Commit

Permalink
fix: update output
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasarchina committed Jan 18, 2023
1 parent 22b0bdc commit 11dfad6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10087,7 +10087,7 @@ var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
// Heavily based on https://github.com/mydea/action-tag-date-version with some changes to the date and added prefix
const { setFailed, getInput } = __nccwpck_require__(3494);
const { setFailed, getInput, setOutput } = __nccwpck_require__(3494);
const { context } = __nccwpck_require__(4464);
const { exec } = __nccwpck_require__(5420);
const semver = __nccwpck_require__(6585);
Expand All @@ -10098,13 +10098,13 @@ async function run() {
const prefix = getInput("prefix");
const outputOnly = getInput("output-only", { required: false }) === "true";

// const currentVersionTag = await getCurrentTag();
const currentVersionTag = await getCurrentTag();

// if (currentVersionTag) {
// console.log(`Already at version ${currentVersionTag}, skipping...`);
// `version=${currentVersionTag}` >> $GITHUB_OUTPUT;
// return;
// }
if (currentVersionTag) {
console.log(`Already at version ${currentVersionTag}, skipping...`);
setOutput("version", currentVersionTag);
return;
}

let nextVersion = await getNextVersionTag(prefix, prerelease);

Expand Down Expand Up @@ -10141,7 +10141,7 @@ async function run() {
`Only outputting version because output-only is set to ${outputOnly}`
);
}
`version=${nextVersion}` >> $GITHUB_OUTPUT;
setOutput("version", nextVersion);
} catch (error) {
setFailed(error.message);
}
Expand Down
16 changes: 8 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Heavily based on https://github.com/mydea/action-tag-date-version with some changes to the date and added prefix
const { setFailed, getInput } = require("@actions/core");
const { setFailed, getInput, setOutput } = require("@actions/core");
const { context } = require("@actions/github");
const { exec } = require("@actions/exec");
const semver = require("semver");
Expand All @@ -10,13 +10,13 @@ async function run() {
const prefix = getInput("prefix");
const outputOnly = getInput("output-only", { required: false }) === "true";

// const currentVersionTag = await getCurrentTag();
const currentVersionTag = await getCurrentTag();

// if (currentVersionTag) {
// console.log(`Already at version ${currentVersionTag}, skipping...`);
// `version=${currentVersionTag}` >> $GITHUB_OUTPUT;
// return;
// }
if (currentVersionTag) {
console.log(`Already at version ${currentVersionTag}, skipping...`);
setOutput("version", currentVersionTag);
return;
}

let nextVersion = await getNextVersionTag(prefix, prerelease);

Expand Down Expand Up @@ -53,7 +53,7 @@ async function run() {
`Only outputting version because output-only is set to ${outputOnly}`
);
}
`version=${nextVersion}` >> $GITHUB_OUTPUT;
setOutput("version", nextVersion);
} catch (error) {
setFailed(error.message);
}
Expand Down

0 comments on commit 11dfad6

Please sign in to comment.