From bacdc8dc2e3d992ac1a3ea7295532b029b971945 Mon Sep 17 00:00:00 2001 From: Piotr Adamczyk Date: Tue, 27 Oct 2020 15:50:56 +0100 Subject: [PATCH 1/4] fix: Fix getting PR number on pull_request_review --- .github/workflows/integration_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 43dc0dbdcb..8fe7977c43 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -14,7 +14,8 @@ jobs: - name: Count approve count id: reviews run: | - export count=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/flank/flank/pulls/${{github.event.number}}/reviews -s | grep -i -c '"state": "APPROVED"') + PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') + export count=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/flank/flank/pulls/$PR_NUMBER/reviews -s | grep -i -c '"state": "APPROVED"') echo $count echo "::set-output name=approved::${count}" From b8c3c2ce356ae3fb80146a5fc93a69b26dd5908d Mon Sep 17 00:00:00 2001 From: piotradamczyk5 <65554637+piotradamczyk5@users.noreply.github.com> Date: Tue, 27 Oct 2020 16:14:59 +0100 Subject: [PATCH 2/4] Update integration_tests.yml --- .github/workflows/integration_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 8fe7977c43..22c5794720 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -15,7 +15,7 @@ jobs: id: reviews run: | PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') - export count=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/flank/flank/pulls/$PR_NUMBER/reviews -s | grep -i -c '"state": "APPROVED"') + export count2=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/flank/flank/pulls/${PR_NUMBER}/reviews -s | grep -i -c '"state": "APPROVED"') echo $count echo "::set-output name=approved::${count}" From acb03d573787cb6a90fec75cc099f235cdd63fb0 Mon Sep 17 00:00:00 2001 From: piotradamczyk5 <65554637+piotradamczyk5@users.noreply.github.com> Date: Tue, 27 Oct 2020 16:17:05 +0100 Subject: [PATCH 3/4] Update integration_tests.yml --- .github/workflows/integration_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 22c5794720..0d0d0e5458 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -15,6 +15,8 @@ jobs: id: reviews run: | PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') + echo $PR_NUMBER + echo $GITHUB_REF export count2=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/flank/flank/pulls/${PR_NUMBER}/reviews -s | grep -i -c '"state": "APPROVED"') echo $count echo "::set-output name=approved::${count}" From a95dde13eb09e9d5172726076e4ee170e319ced6 Mon Sep 17 00:00:00 2001 From: piotradamczyk5 <65554637+piotradamczyk5@users.noreply.github.com> Date: Tue, 27 Oct 2020 16:18:50 +0100 Subject: [PATCH 4/4] Update integration_tests.yml --- .github/workflows/integration_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 0d0d0e5458..a70bf3fb70 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -17,7 +17,7 @@ jobs: PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') echo $PR_NUMBER echo $GITHUB_REF - export count2=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/flank/flank/pulls/${PR_NUMBER}/reviews -s | grep -i -c '"state": "APPROVED"') + export count=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/flank/flank/pulls/${PR_NUMBER}/reviews -s | grep -i -c '"state": "APPROVED"') echo $count echo "::set-output name=approved::${count}"