This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 4677ce1203adf43005e877bd2a6c7f4159da7946
Author: Szymon Czapracki <[email protected]>
AuthorDate: Fri Oct 24 14:18:49 2025 +0200

    ci: Modify CI approval label workflow
    
    Limit workflow work - enabled only if author is *NOT* a contributor.
    Add debug info for workflow (Might be useful in the future).
---
 .github/workflows/add_ci_label.yml | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/add_ci_label.yml 
b/.github/workflows/add_ci_label.yml
index 4947fd9b0..0d9b5d6fb 100644
--- a/.github/workflows/add_ci_label.yml
+++ b/.github/workflows/add_ci_label.yml
@@ -30,13 +30,37 @@ permissions:
 
 jobs:
   add-label:
-    if: ${{ !contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), 
github.event.pull_request.author_association)
-           && github.actor != 'dependabot[bot]' }}
+    if: ${{ github.event.pull_request.author_association != 'CONTRIBUTOR' }}
     runs-on: ubuntu-latest
     steps:
       - uses: actions/github-script@v7
         with:
           script: |
+           const pr = context.payload.pull_request;
+
+            // Fetch author's repository permission level: 
admin|maintain|write|triage|read|none
+            let permission = 'unknown';
+            try {
+              const { data } = await 
github.rest.repos.getCollaboratorPermissionLevel({
+                ...context.repo,
+                username: pr.user.login,
+              });
+              permission = data.permission;
+            } catch (e) {
+              core.warning(`Could not fetch collaborator permission: 
${e.status || ''} ${e.message}`);
+            }
+
+            const info = {
+              number: pr.number,
+              title: pr.title,
+              author: pr.user.login,
+              author_association: pr.author_association,
+              author_permission: permission,
+              base_repo: pr.base.repo.full_name,
+              head_repo: pr.head.repo.full_name,
+              is_fork: !!pr.head.repo.fork,
+            };
+            core.info('PR author info:\n' + JSON.stringify(info, null, 2));
             const label = 'needs-ci-approval';
             try {
               try {

Reply via email to