diff --git a/.github/workflows/pr-comment-ci.yml b/.github/workflows/pr-comment-ci.yml index 08475ae..667e7d3 100644 --- a/.github/workflows/pr-comment-ci.yml +++ b/.github/workflows/pr-comment-ci.yml @@ -19,12 +19,18 @@ jobs: let next_action = '' const fs = require('fs') const CODEOWNERS = fs.readFileSync('.github/CODEOWNERS', 'utf8') - if (CODEOWNERS.includes(`@${context.payload.comment.user.login}`)) { + const isReviewer = false; + CODEOWNERS.match(/@\w+/g).forEach((owner) => { + if (owner === `@${context.payload.comment.user.login}`) { + isReviewer = true + } + }) + if (isReviewer) { console.log('Allowed') const body = context.payload.comment.body - if (body.startsWith('/update-build')) { - next_action='update-build' - } + if (body.startsWith('/update-dist')) { + next_action='update-dist' + } } else { core.warning('You are not collaborator'); } @@ -36,11 +42,11 @@ jobs: runs-on: ubuntu-latest steps: - run: echo ${{ needs.check.outputs.next_action }} - - update-build: + + update-dist: needs: check runs-on: ubuntu-latest - if: ${{ needs.check.outputs.next_action == 'update-build' }} + if: ${{ needs.check.outputs.next_action == 'update-dist' }} steps: - uses: actions/checkout@v4 - name: gh checkout pr @@ -63,4 +69,4 @@ jobs: git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git commit -m "chore: build" - git push + git push \ No newline at end of file