From 139e4d3b1ffedc00af212f07e469bd94978100af Mon Sep 17 00:00:00 2001 From: Harpalsinh Jadeja Date: Wed, 31 Dec 2025 12:17:12 +0530 Subject: [PATCH 1/2] feat: add PR merge check github action --- .github/workflows/check-pr-author.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/check-pr-author.yml diff --git a/.github/workflows/check-pr-author.yml b/.github/workflows/check-pr-author.yml new file mode 100644 index 00000000..0e7e2475 --- /dev/null +++ b/.github/workflows/check-pr-author.yml @@ -0,0 +1,27 @@ +name: Check PR Author for Merge Permission + +on: + pull_request: + types: [opened, synchronize, reopened] # Trigger on new PRs or updates + +jobs: + check-author: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v7 + with: + script: | + const allowedUsers = ['keone', 'NoahMarconi', 'AustinGreen', 'kristovatlas', 'therealharpaljadeja', 'nishuzumi', 'portdeveloper']; // Keone, Security Team, Head of Eng, DevRel + const prAuthor = context.payload.pull_request.user.login; + const state = allowedUsers.includes(prAuthor) ? 'success' : 'failure'; + const description = allowedUsers.includes(prAuthor) ? 'PR author is allowed to merge' : 'PR author not allowed to merge'; + + await github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: context.payload.pull_request.head.sha, + state: state, + context: 'merge-allowed-check', // Custom name for the status check + description: description + }); + From 54a4434d4c758429ce8769083db2c5746e05bbd4 Mon Sep 17 00:00:00 2001 From: Harpalsinh Jadeja Date: Wed, 31 Dec 2025 12:21:53 +0530 Subject: [PATCH 2/2] fix: the gh pr action --- .github/workflows/check-pr-author.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-pr-author.yml b/.github/workflows/check-pr-author.yml index 0e7e2475..38dc3696 100644 --- a/.github/workflows/check-pr-author.yml +++ b/.github/workflows/check-pr-author.yml @@ -4,6 +4,10 @@ on: pull_request: types: [opened, synchronize, reopened] # Trigger on new PRs or updates +permissions: + statuses: write + pull-requests: read + jobs: check-author: runs-on: ubuntu-latest