mirror of
https://github.com/mshick/add-pr-comment.git
synced 2026-01-01 14:49:44 +11:00
new build
This commit is contained in:
parent
4a541a260f
commit
73ffb32342
4 changed files with 3888 additions and 1216 deletions
|
|
@ -22,14 +22,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getInputs = void 0;
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const github = __importStar(require("@actions/github"));
|
||||
const promises_1 = __importDefault(require("node:fs/promises"));
|
||||
const util_1 = require("./util");
|
||||
async function getInputs() {
|
||||
var _a, _b;
|
||||
const messageIdInput = core.getInput('message-id', { required: false });
|
||||
|
|
@ -45,12 +42,12 @@ async function getInputs() {
|
|||
const allowRepeats = core.getInput('allow-repeats', { required: true }) === 'true';
|
||||
const refreshMessagePosition = core.getInput('refresh-message-position', { required: false }) === 'true';
|
||||
const updateOnly = core.getInput('update-only', { required: false }) === 'true';
|
||||
if (messageInput && messagePath) {
|
||||
if (messageInput && messagePath.length) {
|
||||
throw new Error('must specify only one, message or message-path');
|
||||
}
|
||||
let message;
|
||||
if (messagePath) {
|
||||
message = await promises_1.default.readFile(messagePath, { encoding: 'utf8' });
|
||||
if (messagePath.length) {
|
||||
message = await (0, util_1.getMessageFromPaths)(messagePath);
|
||||
}
|
||||
else {
|
||||
message = messageInput;
|
||||
|
|
@ -76,16 +73,16 @@ async function getInputs() {
|
|||
}
|
||||
const { payload } = github.context;
|
||||
return {
|
||||
refreshMessagePosition,
|
||||
allowRepeats,
|
||||
commitSha: github.context.sha,
|
||||
issue: issue ? Number(issue) : (_a = payload.issue) === null || _a === void 0 ? void 0 : _a.number,
|
||||
message,
|
||||
messageId: `<!-- ${messageId} -->`,
|
||||
proxyUrl,
|
||||
pullRequestNumber: (_b = payload.pull_request) === null || _b === void 0 ? void 0 : _b.number,
|
||||
refreshMessagePosition,
|
||||
repoToken,
|
||||
status,
|
||||
issue: issue ? Number(issue) : (_a = payload.issue) === null || _a === void 0 ? void 0 : _a.number,
|
||||
pullRequestNumber: (_b = payload.pull_request) === null || _b === void 0 ? void 0 : _b.number,
|
||||
commitSha: github.context.sha,
|
||||
owner: repoOwner || payload.repo.owner,
|
||||
repo: repoName || payload.repo.repo,
|
||||
updateOnly: updateOnly,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue