From 06f3c5d32b40ea7610fcb437142270e1e821feb2 Mon Sep 17 00:00:00 2001 From: Junyan Qin <1010553892@qq.com> Date: Wed, 27 Dec 2023 15:39:08 +0000 Subject: [PATCH] =?UTF-8?q?test:=20=E5=88=86=E6=94=AF=E5=90=8D=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-pr.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 8774b7e3..819b3732 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -40,19 +40,33 @@ 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: Get PR details - if: github.event_name == 'issue_comment' id: get-pr + if: github.event_name == 'issue_comment' 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' + + - name: Set PR source branch as env variable + if: github.event_name != 'issue_comment' run: | - echo "BRANCH=${{ steps.get-pr.outputs.data.head.ref }}" >> $GITHUB_ENV + PR_SOURCE_BRANCH=$(echo ${{ steps.get-pr.outputs.data }} | jq -r '.head.ref') + echo "BRANCH=$PR_SOURCE_BRANCH" >> $GITHUB_ENV - name: Set PR Branch as bash env if: github.event_name != 'issue_comment' run: |