Update github action file

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