From 0138dd6d4a98d2775f398d0deb383938dfa33ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Tue, 25 Jun 2024 11:46:15 +0800 Subject: [PATCH] wip: pr-comment-ci --- .github/workflows/pr-comment-ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-comment-ci.yml b/.github/workflows/pr-comment-ci.yml index eb519a8..8e3797b 100644 --- a/.github/workflows/pr-comment-ci.yml +++ b/.github/workflows/pr-comment-ci.yml @@ -17,11 +17,16 @@ jobs: with: script: | let next_action = '' - const fs = import('fs') + let isReviewer = false; + const user = context.payload.comment.user.login + core.debug(`user: ${user}`) + + const fs = require('fs') const CODEOWNERS = fs.readFileSync('.github/CODEOWNERS', 'utf8') - const isReviewer = false; + core.debug(`CODEOWNERS: ${CODEOWNERS}`) + CODEOWNERS.match(/@\w+/g).forEach((owner) => { - if (owner === `@${context.payload.comment.user.login}`) { + if (owner === `@${user}`) { isReviewer = true } })