Update github action file

This commit is contained in:
شركة خبير المحدودة 2025-11-26 14:21:20 +02:00
parent f031e36c06
commit a72e22746a
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;
if (commitAuthor && !allowed.includes(commitAuthor)) { # for (const commit of commitList.data) {
core.error(`Unauthorized commit author: ${commitAuthor}. Closing PR...`); # const commitAuthor = commit.author ? commit.author.login : null;
await github.rest.pulls.update({ # if (commitAuthor && !allowed.includes(commitAuthor)) {
owner, # core.error(`Unauthorized commit author: ${commitAuthor}. Closing PR...`);
repo,
pull_number: pr.number,
state: "closed"
});
return; # await github.rest.pulls.update({
} # owner,
} # repo,
# pull_number: pr.number,
# state: "closed"
# });
core.info("All PR authors and committers are allowed."); # return;
# }
# }
# core.info("All PR authors and committers are allowed.");