HXOR-196 - get pr number change (#8411)

* check new action

* check new action

* check new action

* check new action

* check new action

* check new action

* check new action

* check new action

* get PR number

* get PR number

* get PR number

* get PR number

* get PR number

* get PR number

* get PR number

* final check

* final check

* use external action from build tool

* check new action

* use sha commit instead of ref number

* [ci:force]

* [ci:force]

* [ci:force]

* fix
This commit is contained in:
Maurizio Cacace
2023-03-28 08:54:54 +02:00
committed by GitHub
parent a61658eadf
commit 4d817e5762
2 changed files with 11 additions and 5 deletions

View File

@@ -119,7 +119,6 @@ jobs:
exit 0 exit 0
else else
git fetch --all git fetch --all
echo "$BRANCH_NAME"
message=$(git log --format=%B -n 1 origin/$BRANCH_NAME) message=$(git log --format=%B -n 1 origin/$BRANCH_NAME)
echo "COMMIT_MESSAGE=$message" >> $GITHUB_ENV echo "COMMIT_MESSAGE=$message" >> $GITHUB_ENV
export COMMIT_MESSAGE=$message export COMMIT_MESSAGE=$message
@@ -131,11 +130,17 @@ jobs:
fi fi
- name: Get PR number - name: Get PR number
id: action
if: ${{ github.event_name != 'schedule' }} if: ${{ github.event_name != 'schedule' }}
uses: kamatama41/get-pr-number-action@5c77b38a1b4974ebf8a9521a689f38a5898eadd6 uses: kamatama41/get-pr-number-action@5c77b38a1b4974ebf8a9521a689f38a5898eadd6
id: action
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- name: show pr number
shell: bash
run: |
echo "PR: ${{ steps.action.outputs.number }}"
- name: check if pr is approved - name: check if pr is approved
env: env:
DEVEL_FLAG: ${{ inputs.devel }} DEVEL_FLAG: ${{ inputs.devel }}
@@ -166,7 +171,8 @@ jobs:
if [ "$skip_check" == "false" ]; then if [ "$skip_check" == "false" ]; then
echo "Checking PR approval" echo "Checking PR approval"
prNumber=${{ 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') echo "PR: $prNumber"
checkApproval=$(gh api /repos/$GITHUB_REPOSITORY/pulls/$prNumber/reviews | jq '.[] | select(.state == "APPROVED") | .user.login')
if [[ $checkApproval ]]; then if [[ $checkApproval ]]; then
echo -e "\033[32mPR approved\033[0m" echo -e "\033[32mPR approved\033[0m"
else else

View File

@@ -178,7 +178,7 @@ jobs:
- uses: ./.github/actions/download-node-modules-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- name: check PR number - name: check PR number
id: action id: action
uses: kamatama41/get-pr-number-action@v0 uses: kamatama41/get-pr-number-action@5c77b38a1b4974ebf8a9521a689f38a5898eadd6
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
- name: save PR number - name: save PR number