Stig Otnes Kolstad 2f6bfda1e2
Use @actions/core.exportVariable instead of set-env (#19)
* fix: use @actions/core.exportVariable instead of set-env

`set-env` is now deprecated. `@actions/core` exposes `exportVariable`
to be used instead.

https://github.com/actions/toolkit/tree/main/packages/core#exporting-variables

* chore: bump @actions/core to v1.2.6
2020-10-20 12:21:52 +05:30

29 lines
1.1 KiB
JavaScript

"use strict";
// For internal use, subject to change.
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 });
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(require("fs"));
const os = __importStar(require("os"));
const utils_1 = require("./utils");
function issueCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`);
}
if (!fs.existsSync(filePath)) {
throw new Error(`Missing file at path: ${filePath}`);
}
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
encoding: 'utf8'
});
}
exports.issueCommand = issueCommand;
//# sourceMappingURL=file-command.js.map