Skip to content

Commit

Permalink
feat: GITHUB_EVENT_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnAngela authored Jan 1, 2025
1 parent 5d1b824 commit bab578c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/autoAssign/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ if (!isInGithubActions) {
console.info("Not in github actions, exit.");
process.exit(0);
}
const { action, number } = await readWorkflowEvent();
const event = await readWorkflowEvent();
const { action, number } = event;
if (action !== "opened") {
console.info("The pull request is not opened, exit.");
process.exit(0);
Expand All @@ -28,8 +29,7 @@ const { addReviewers, reviewers, addAssignees, assignees } = config;
if (addReviewers) {
if (Array.isArray(reviewers) && reviewers.length > 0) {
try {
const event = await jsonModule.readFile(process.env.GITHUB_EVENT_PATH);
const login = event.pull_request.user.login;
const { pull_request: { user: { login } } } = event;
if (reviewers.includes(login)) {
console.info("[addReviewers]", "The author is in the reviewers list, remove it.");
reviewers.splice(reviewers.indexOf(login), 1);
Expand Down

0 comments on commit bab578c

Please sign in to comment.