Skip to content

Commit

Permalink
chore: upload packaged files
Browse files Browse the repository at this point in the history
  • Loading branch information
linhe0x0 committed Feb 15, 2023
1 parent 9ba39a9 commit 657cf89
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
24 changes: 20 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ function handlePullRequest(client, context, config) {
}
}
}
let reviewers = [];
let assignees = [];
if (addReviewers) {
try {
const reviewers = utils.chooseReviewers(owner, config);
reviewers = utils.chooseReviewers(owner, config);
if (reviewers.length > 0) {
yield pr.addReviewers(reviewers);
core.info(`Added reviewers to PR #${number}: ${reviewers.join(', ')}`);
Expand All @@ -99,7 +101,7 @@ function handlePullRequest(client, context, config) {
}
if (addAssignees) {
try {
const assignees = utils.chooseAssignees(owner, config);
assignees = utils.chooseAssignees(owner, config);
if (assignees.length > 0) {
yield pr.addAssignees(assignees);
core.info(`Added assignees to PR #${number}: ${assignees.join(', ')}`);
Expand All @@ -111,6 +113,10 @@ function handlePullRequest(client, context, config) {
}
}
}
return {
reviewers,
assignees,
};
});
}
exports.handlePullRequest = handlePullRequest;
Expand Down Expand Up @@ -258,7 +264,13 @@ function run() {
path: configPath,
ref: sha,
});
yield handler.handlePullRequest(client, github.context, config);
const output = yield handler.handlePullRequest(client, github.context, config);
if (output) {
const reviewers = utils.toMentions(output.reviewers);
const assignees = utils.toMentions(output.assignees);
core.setOutput('reviewers', reviewers);
core.setOutput('assignees', assignees);
}
}
catch (error) {
if (error instanceof Error) {
Expand Down Expand Up @@ -313,7 +325,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.fetchConfigurationFile = exports.chooseUsersFromGroups = exports.includesSkipKeywords = exports.chooseUsers = exports.chooseAssignees = exports.chooseReviewers = void 0;
exports.toMentions = exports.fetchConfigurationFile = exports.chooseUsersFromGroups = exports.includesSkipKeywords = exports.chooseUsers = exports.chooseAssignees = exports.chooseReviewers = void 0;
const lodash_1 = __importDefault(__nccwpck_require__(250));
const yaml = __importStar(__nccwpck_require__(1917));
function chooseReviewers(owner, config) {
Expand Down Expand Up @@ -396,6 +408,10 @@ function fetchConfigurationFile(client, options) {
});
}
exports.fetchConfigurationFile = fetchConfigurationFile;
function toMentions(usernames) {
return usernames.map(username => `@${username}`).join(', ');
}
exports.toMentions = toMentions;


/***/ }),
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit 657cf89

Please sign in to comment.