mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
AAE-12046 - add pre-condition on approval (#8145)
* add pre-condition on approval * adjustment * add approval check * devel check false * devel check true * restyling * check with PR approved
This commit is contained in:
parent
616ae95c23
commit
b99a574f94
1
.github/workflows/adf_alpha.yml
vendored
1
.github/workflows/adf_alpha.yml
vendored
@ -74,7 +74,6 @@ jobs:
|
||||
shell: bash
|
||||
if: ${{ contains(github.event.head_commit.message, '[trigger adf]') || inputs.cluster_operation == 'TRIGGER_ALPHA_ADF' || github.event.schedule == '0 12 * * *' }}
|
||||
run: |
|
||||
pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
|
||||
npm install github-api
|
||||
./scripts/travis/update/update-project.sh -p $TRAVIS_BUILD_NUMBER -t $GH_TOKEN -v alpha -c $TRAVIS_COMMIT
|
||||
|
35
.github/workflows/pull-request.yml
vendored
35
.github/workflows/pull-request.yml
vendored
@ -65,12 +65,47 @@ env:
|
||||
DOCKER_REPOSITORY: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/demo-shell"
|
||||
|
||||
jobs:
|
||||
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 }}
|
||||
DEVEL_FLAG: false #put it to true if you need to develop the pipeline on your own branch. before the final merge put it to false
|
||||
shell: bash
|
||||
if: ${{ github.event_name != 'schedule' }}
|
||||
run: |
|
||||
if [[ "$DEVEL_FLAG" = false ]] ; then
|
||||
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
|
||||
else
|
||||
echo "you are on your branch: skipping the check. REMEMBER to put DEVEL_FLAG to FALSE before the final merge!"
|
||||
fi
|
||||
|
||||
setup:
|
||||
# long timeout required when cache has to be recreated
|
||||
timeout-minutes: 30
|
||||
name: "Setup"
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [check-if-pr-is-approved]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
Loading…
x
Reference in New Issue
Block a user