Update github action file

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

View File

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