From 4e71a08b57df4aa5c5cd8a8d05dc0e75d649bc9d Mon Sep 17 00:00:00 2001 From: Junyan Qin <1010553892@qq.com> Date: Wed, 27 Dec 2023 15:35:25 +0000 Subject: [PATCH] =?UTF-8?q?test:=20=E5=AE=8C=E5=96=84issues=5Fcomment?= =?UTF-8?q?=E6=97=B6=E7=9A=84pr=E5=88=86=E6=94=AF=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-pr.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 415c25ee..8774b7e3 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -40,7 +40,21 @@ jobs: cd qcg-tester python -m pip install --upgrade pip pip install -r requirements.txt + - name: Get PR details + if: github.event_name == 'issue_comment' + id: get-pr + uses: octokit/request-action@v2.x + with: + route: GET /repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} + mediaType: '{"previews": ["shadow-cat"]}' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set Got PR Branch as bash env + if: github.event_name == 'issue_comment' + run: | + echo "BRANCH=${{ steps.get-pr.outputs.data.head.ref }}" >> $GITHUB_ENV - name: Set PR Branch as bash env + if: github.event_name != 'issue_comment' run: | echo "BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV - name: Set OpenAI API Key from Secrets