From 42198062f30d335019107b4d772e8f00981e8355 Mon Sep 17 00:00:00 2001 From: effozen Date: Wed, 6 Nov 2024 18:24:12 +0900 Subject: [PATCH] =?UTF-8?q?[ENV][Feat]=20#1=20:=20auto-assign-reviewers=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-assign-reviewers.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-assign-reviewers.yml b/.github/workflows/auto-assign-reviewers.yml index a0ef5d2e..97e38488 100644 --- a/.github/workflows/auto-assign-reviewers.yml +++ b/.github/workflows/auto-assign-reviewers.yml @@ -12,19 +12,23 @@ jobs: uses: actions/github-script@v6 with: script: | - await github.issues.addAssignees({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number, - assignees: [context.payload.pull_request.user.login], - }); + if (context.payload.pull_request) { + await github.issues.addAssignees({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + assignees: [context.payload.pull_request.user.login], + }); + } else { + console.log('No pull_request data found in context.payload'); + } - name: 'Add "확인 요청" Label if not present' uses: actions/github-script@v6 id: label_check with: script: | - const labels = context.payload.pull_request.labels; + const labels = context.payload.pull_request.labels || []; if (!labels.some(label => label.name === '확인 요청')) { await github.issues.addLabels({ owner: context.repo.owner,