Skip to content

Commit

Permalink
Merge pull request #361 from peter-evans/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
peter-evans committed Sep 2, 2021
2 parents a786383 + 8600ab5 commit cd1af3b
Show file tree
Hide file tree
Showing 4 changed files with 7,522 additions and 1,538 deletions.
54 changes: 42 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ function run() {
comment: core.getInput('comment'),
deleteBranch: toBool(core.getInput('delete-branch'), false)
};
core.debug(`Inputs: ${util_1.inspect(inputs)}`);
core.debug(`Inputs: ${(0, util_1.inspect)(inputs)}`);
const [owner, repo] = inputs.repository.split('/');
core.debug(`Repo: ${util_1.inspect(repo)}`);
core.debug(`Repo: ${(0, util_1.inspect)(repo)}`);
const octokit = github.getOctokit(inputs.token);
if (inputs.comment && inputs.comment.length > 0) {
core.info('Adding a comment before closing the pull request');
Expand All @@ -85,7 +85,7 @@ function run() {
repo: repo,
pull_number: inputs.pullRequestNumber
});
core.debug(`Pull: ${util_1.inspect(pull)}`);
core.debug(`Pull: ${(0, util_1.inspect)(pull)}`);
const ref = 'heads/' + pull['head']['ref'];
core.debug(`Pull request head ref: ${ref}`);
// Attempt to delete the ref. This will fail if
Expand All @@ -99,12 +99,12 @@ function run() {
});
}
catch (error) {
core.debug(util_1.inspect(error));
core.debug((0, util_1.inspect)(error));
}
}
}
catch (error) {
core.debug(util_1.inspect(error));
core.debug((0, util_1.inspect)(error));
core.setFailed(error.message);
}
});
Expand Down Expand Up @@ -247,7 +247,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
const command_1 = __nccwpck_require__(351);
const file_command_1 = __nccwpck_require__(717);
const utils_1 = __nccwpck_require__(278);
Expand Down Expand Up @@ -425,19 +425,30 @@ exports.debug = debug;
/**
* Adds an error issue
* @param message error issue message. Errors will be converted to string via toString()
* @param properties optional properties to add to the annotation.
*/
function error(message) {
command_1.issue('error', message instanceof Error ? message.toString() : message);
function error(message, properties = {}) {
command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
}
exports.error = error;
/**
* Adds an warning issue
* Adds a warning issue
* @param message warning issue message. Errors will be converted to string via toString()
* @param properties optional properties to add to the annotation.
*/
function warning(message) {
command_1.issue('warning', message instanceof Error ? message.toString() : message);
function warning(message, properties = {}) {
command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
}
exports.warning = warning;
/**
* Adds a notice issue
* @param message notice issue message. Errors will be converted to string via toString()
* @param properties optional properties to add to the annotation.
*/
function notice(message, properties = {}) {
command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
}
exports.notice = notice;
/**
* Writes info to log with console.log.
* @param message info message
Expand Down Expand Up @@ -571,7 +582,7 @@ exports.issueCommand = issueCommand;
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.toCommandValue = void 0;
exports.toCommandProperties = exports.toCommandValue = void 0;
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
Expand All @@ -586,6 +597,25 @@ function toCommandValue(input) {
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
/**
*
* @param annotationProperties
* @returns The command properties to send with the actual annotation command
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
*/
function toCommandProperties(annotationProperties) {
if (!Object.keys(annotationProperties).length) {
return {};
}
return {
title: annotationProperties.title,
line: annotationProperties.startLine,
endLine: annotationProperties.endLine,
col: annotationProperties.startColumn,
endColumn: annotationProperties.endColumn
};
}
exports.toCommandProperties = toCommandProperties;
//# sourceMappingURL=utils.js.map

/***/ }),
Expand Down

0 comments on commit cd1af3b

Please sign in to comment.