Commit 6e63d9c 1 parent ca7b54e commit 6e63d9c Copy full SHA for 6e63d9c
File tree 1 file changed +0
-24
lines changed
nf_core/pipeline-template/.github/workflows
1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change 17
17
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'
18
18
runs-on : ubuntu-latest
19
19
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
-
44
20
- name : Set revision variable
45
21
id : revision
46
22
run : |
You can’t perform that action at this time.
0 commit comments