File tree Expand file tree Collapse file tree 1 file changed +0
-24
lines changed
nf_core/pipeline-template/.github/workflows Expand file tree Collapse file tree 1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change 1717 if : github.repository == '{{ name }}' && github.event.review.state == 'approved' && (github.event.pull_request.base.ref == 'master' || github.event.pull_request.base.ref == 'main') || github.event_name == 'workflow_dispatch'
1818 runs-on : ubuntu-latest
1919 steps :
20- - name : Get PR reviews
21- 22- if : github.event_name != 'workflow_dispatch'
23- id : check_approvals
24- continue-on-error : true
25- with :
26- route : GET /repos/{%- raw -%}${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews?per_page=100
27- env :
28- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29-
30- - name : Check for approvals
31- if : ${{ failure() && github.event_name != 'workflow_dispatch' }}
32- run : |
33- echo "No review approvals found. At least 2 approvals are required to run this action automatically."
34- exit 1
35-
36- - name : Check for enough approvals (>=2)
37- id : test_variables
38- if : github.event_name != 'workflow_dispatch'
39- run : |
40- JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}'
41- CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length')
42- test $CURRENT_APPROVALS_COUNT -ge 2 || exit 1 # At least 2 approvals are required
43-
4420 - name : Set revision variable
4521 id : revision
4622 run : |
You can’t perform that action at this time.
0 commit comments