mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
add pre-condition on approved PR
This commit is contained in:
parent
73e1953418
commit
55b146044e
34
.github/workflows/pull-request.yml
vendored
34
.github/workflows/pull-request.yml
vendored
@ -8,9 +8,6 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
push:
|
||||
branches:
|
||||
- AAE-12046-pr-condition
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
@ -68,8 +65,37 @@ env:
|
||||
DOCKER_REPOSITORY: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/demo-shell"
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
check-if-pr-is-approved:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check if PR is approved
|
||||
id: action
|
||||
uses: kamatama41/get-pr-number-action@v0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Show the number
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
shell: bash
|
||||
if: ${{ github.event_name != 'schedule' }}
|
||||
run: |
|
||||
echo "PR number is: ${{ steps.action.outputs.number }}"
|
||||
prNumber=${{ steps.action.outputs.number }}
|
||||
checkApproval=$(gh api /repos/Alfresco/alfresco-ng2-components/pulls/$prNumber/reviews | jq '.[] | select(.state == "APPROVED") | .user.login')
|
||||
if [[ $checkApproval ]]; then
|
||||
echo "PR approved"
|
||||
else
|
||||
echo "PR not approved yet"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
setup:
|
||||
# long timeout required when cache has to be recreated
|
||||
timeout-minutes: 30
|
||||
name: "Setup"
|
||||
|
Loading…
x
Reference in New Issue
Block a user