diff --git a/.github/workflows/consumer-tests-pr.yml b/.github/workflows/consumer-tests-pr.yml index 6f9b8f6c5a..bbec90c7f0 100644 --- a/.github/workflows/consumer-tests-pr.yml +++ b/.github/workflows/consumer-tests-pr.yml @@ -20,7 +20,21 @@ jobs: ) runs-on: ubuntu-latest steps: + - name: Get pull request URL + id: pull_request + run: | + echo "::set-output name=pull_request::$(curl ${{ github.event.comment.issue_url }} | + jq '.pull_request.url' | + sed 's/\"//g')" + - name: Get branch name + id: branch_name + run: | + echo "::set-output name=branch_name::$(curl ${{ steps.pull_request.outputs.pull_request }} | + jq '.head.ref' | + sed 's/\"//g')" - uses: actions/checkout@v3 + with: + ref: ${{ steps.branch_name.outputs.branch_name }} - uses: actions/setup-java@v1 with: java-version: 11 diff --git a/.github/workflows/integration-tests-pr.yml b/.github/workflows/integration-tests-pr.yml index 1955898ede..13dfae7ffd 100644 --- a/.github/workflows/integration-tests-pr.yml +++ b/.github/workflows/integration-tests-pr.yml @@ -29,7 +29,21 @@ jobs: sha: ${{ steps.sha.outputs.sha }} runs-on: ubuntu-latest steps: + - name: Get pull request URL + id: pull_request + run: | + echo "::set-output name=pull_request::$(curl ${{ github.event.comment.issue_url }} | + jq '.pull_request.url' | + sed 's/\"//g')" + - name: Get branch name + id: branch_name + run: | + echo "::set-output name=branch_name::$(curl ${{ steps.pull_request.outputs.pull_request }} | + jq '.head.ref' | + sed 's/\"//g')" - uses: actions/checkout@v3 + with: + ref: ${{ steps.branch_name.outputs.branch_name }} - name: Get commit SHA id: sha run: |