diff --git a/.github/workflows/on-pull-request.yaml b/.github/workflows/on-pull-request.yaml index da7670d70..6f4bba917 100644 --- a/.github/workflows/on-pull-request.yaml +++ b/.github/workflows/on-pull-request.yaml @@ -66,6 +66,7 @@ jobs: - name: Create PR in ${{ secrets.FORK_REPOSITORY_ORGANISATION }}/${{ secrets.FORK_REPOSITORY_NAME }} if: steps.sync_fork.outcome == 'failure' + id: create_pr run: | echo "The 'sync_fork' step failed. Creating a PR in ${SYNC_FORK_REPOSITORY_PATH}" if gh pr create \ @@ -87,7 +88,7 @@ jobs: echo RESULT=$(grep ${FORK_REPOSITORY_PATH} result.txt) >> $GITHUB_ENV echo STATUS="Created" >> $GITHUB_ENV elif grep -q "No commits" result.txt; then - printf "No commits between develop and develop: $(cat result.txt)\n" + printf "No commits between branches: $(cat result.txt)\n" echo RESULT=$(cat result.txt) >> $GITHUB_ENV echo STATUS="NoChange" >> $GITHUB_ENV else @@ -95,15 +96,12 @@ jobs: echo RESULT=$(cat result.txt) >> $GITHUB_ENV echo STATUS="Failed" >> $GITHUB_ENV fi - echo "WAS IT EXECUTED?" fi - name: Send slack notification if: steps.sync_fork.outcome == 'failure' run: | - [ "x$STATUS" == "xSynced" ] && \ - echo "No need to create PR: $RESULT" && exit 0 - [ "x$STATUS" == "xNoChange" ] && \ - echo "No need to create PR: $RESULT" && exit 0 + ([ "x$STATUS" == "xSynced" ] || [ "x$STATUS" == "xNoChange" ]) && \ + echo "No need to create PR: $RESULT ${{ steps.create_pr.outcome }}" && exit 0 [ "x$STATUS" == "xCreated" ] && \ FORK_STATUS="⚠️ Changes was not synced with Farajaland repo due to merge conflicts, please merge PR $RESULT manually to keep Farajaland in sync Countryconfig" [ "x$STATUS" == "xFailed" ] && \