Update github action file

This commit is contained in:
شركة خبير المحدودة 2025-11-26 14:16:30 +02:00
parent ef2a8bf2d9
commit 72bcf917c7
1 changed files with 16 additions and 14 deletions

View File

@ -82,21 +82,23 @@ jobs:
pull_number: pr.number pull_number: pr.number
}); });
for (const commit of commitList.data) { core.info("PR author is allowed.");
const commitAuthor = commit.author ? commit.author.login : null;
# for (const commit of commitList.data) {
# const commitAuthor = commit.author ? commit.author.login : null;
if (commitAuthor && !allowed.includes(commitAuthor)) { # if (commitAuthor && !allowed.includes(commitAuthor)) {
core.error(`Unauthorized commit author: ${commitAuthor}. Closing PR...`); # core.error(`Unauthorized commit author: ${commitAuthor}. Closing PR...`);
await github.rest.pulls.update({ # await github.rest.pulls.update({
owner, # owner,
repo, # repo,
pull_number: pr.number, # pull_number: pr.number,
state: "closed" # state: "closed"
}); # });
return; # return;
} # }
} # }
core.info("All PR authors and committers are allowed."); # core.info("All PR authors and committers are allowed.");