Skip to content

Commit

Permalink
chore: rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Morrison Cole committed May 9, 2020
1 parent 1b32ea7 commit cb860e4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ const github = __importStar(require("@actions/github"));
async function run() {
var _a, _b;
const githubContext = github.context;
const githubToken = core.getInput('repo-token');
const githubToken = core.getInput("repo-token");
const githubClient = new github_1.GitHub(githubToken);
const pr = githubContext.issue;
const titleRegex = new RegExp(core.getInput('title-regex'));
const title = (_b = (_a = githubContext.payload.pull_request) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : '';
const titleRegex = new RegExp(core.getInput("title-regex"));
const title = (_b = (_a = githubContext.payload.pull_request) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : "";
const onFailedRegexComment = core
.getInput('on-failed-regex-comment')
.replace('%regex%', titleRegex.source);
.getInput("on-failed-regex-comment")
.replace("%regex%", titleRegex.source);
core.debug(`Title Regex: ${titleRegex}`);
core.debug(`Title: ${title}`);
const titleMatchesRegex = titleRegex.test(title);
Expand All @@ -30,28 +30,28 @@ async function run() {
repo: pr.repo,
pull_number: pr.number,
body: onFailedRegexComment,
event: 'REQUEST_CHANGES'
event: "REQUEST_CHANGES",
});
}
else {
const reviews = await githubClient.pulls.listReviews({
owner: pr.owner,
repo: pr.repo,
pull_number: pr.number
pull_number: pr.number,
});
reviews.data.forEach(review => {
if (review.user.login == 'github-actions[bot]') {
reviews.data.forEach((review) => {
if (review.user.login == "github-actions[bot]") {
githubClient.pulls.dismissReview({
owner: pr.owner,
repo: pr.repo,
pull_number: pr.number,
review_id: review.id,
message: 'All good!'
message: "All good!",
});
}
});
}
}
run().catch(error => {
run().catch((error) => {
core.setFailed(error);
});

0 comments on commit cb860e4

Please sign in to comment.