From ffc72e24cfe6a003ca1dfd0fbe18c3387da85154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B4=D8=B1=D9=83=D8=A9=20=D8=AE=D8=A8=D9=8A=D8=B1=20?= =?UTF-8?q?=D8=A7=D9=84=D9=85=D8=AD=D8=AF=D9=88=D8=AF=D8=A9?= Date: Sat, 22 Nov 2025 02:20:37 +0200 Subject: [PATCH] Update github action file --- .github/workflows/restrict-pr-authors.yaml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/restrict-pr-authors.yaml b/.github/workflows/restrict-pr-authors.yaml index 51a381dc8..478ca7e20 100644 --- a/.github/workflows/restrict-pr-authors.yaml +++ b/.github/workflows/restrict-pr-authors.yaml @@ -31,7 +31,7 @@ on: - dev_odex25_donation jobs: - validate: + validate_pr_author: runs-on: linting_odex25-standard-modules_runner steps: @@ -40,26 +40,24 @@ jobs: with: github-token: ${{ secrets.PR_CLOSE_TOKEN }} script: | - // List of allowed users (all lowercase) const allowed = [ "expsa", "moutazmuhammad", "ronozoro", - "abubaker-altaib", + "Abubaker-Altaib", "altexp", "the5abir", "ahmadaking", "kchyounes19", "abdurrahman-saber" - ].map(u => u.toLowerCase()); + ]; const pr = context.payload.pull_request; - const prAuthor = pr.user.login.toLowerCase(); + const prAuthor = pr.user.login; const owner = context.repo.owner; const repo = context.repo.repo; core.info(`PR author: ${prAuthor}`); - core.info(`Allowed users: ${allowed.join(", ")}`); // Check PR author if (!allowed.includes(prAuthor)) { @@ -81,11 +79,7 @@ jobs: }); for (const commit of commitList.data) { - const commitAuthor = commit.author ? commit.author.login.toLowerCase() : null; - - if (!commit.author) { - core.warning(`Commit ${commit.sha} has no GitHub-linked author.`); - } + const commitAuthor = commit.author ? commit.author.login : null; if (commitAuthor && !allowed.includes(commitAuthor)) { core.error(`Unauthorized commit author: ${commitAuthor}. Closing PR...`);