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

Update workflow to avoid issue with setOutput method #379

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
37 changes: 29 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,25 @@ module.exports = {

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
Expand All @@ -1099,23 +1118,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs = __importStar(__webpack_require__(747));
const core = __importStar(__webpack_require__(470));
const semver = __importStar(__webpack_require__(876));
const GITHUB_OUTPUT = process.env.GITHUB_OUTPUT || '';
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const currentVersion = core.getInput('current_version');
const bumpLevel = core.getInput('level');
const newVersion = yield bumpSemver(currentVersion, bumpLevel);
core.setOutput('new_version', newVersion);
fs.appendFileSync(GITHUB_OUTPUT, `new_version=${newVersion}\n`);
}
catch (e) {
core.error(e);
Expand Down Expand Up @@ -1875,6 +1889,13 @@ const major = (a, loose) => new SemVer(a, loose).major
module.exports = major


/***/ }),

/***/ 747:
/***/ (function(module) {

module.exports = require("fs");

/***/ }),

/***/ 752:
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import * as fs from 'fs';
import * as core from '@actions/core';
import * as semver from 'semver';

const GITHUB_OUTPUT = process.env.GITHUB_OUTPUT || '';

async function run(): Promise<void> {
try {
const currentVersion = core.getInput('current_version');
const bumpLevel = core.getInput('level');

const newVersion = await bumpSemver(currentVersion, bumpLevel);
core.setOutput('new_version', newVersion);
fs.appendFileSync(GITHUB_OUTPUT, `new_version=${newVersion}\n`);
} catch (e) {
core.error(e);
core.setFailed(e.message);
Expand Down