diff --git a/.github/workflows/label-cherry-pick.yaml b/.github/workflows/label-cherry-pick.yaml index 82eddb70c24cc..6788ea9cf93be 100644 --- a/.github/workflows/label-cherry-pick.yaml +++ b/.github/workflows/label-cherry-pick.yaml @@ -46,9 +46,7 @@ jobs: runs-on: ubuntu-latest needs: prepare_branch_list if: | - needs.prepare_branch_list.outputs.target_branch != '[]' && - github.event.pull_request.merged == true && - github.event.pull_request.merge_commit_sha != null + needs.prepare_branch_list.outputs.target_branch != '[]' strategy: matrix: target_branch: ${{ fromJson(needs.prepare_branch_list.outputs.target_branch) }} @@ -72,6 +70,7 @@ jobs: - name: Cherry pick merge commit id: cherry-pick + continue-on-error: true run: | set -e git fetch origin ${{ matrix.target_branch }} @@ -81,7 +80,6 @@ jobs: - name: Create Pull Request id: create-pr - if: always() uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3 with: token: ${{ secrets.CHERRY_PICK_TOKEN }} @@ -96,7 +94,7 @@ jobs: ${{ github.event.pull_request.body }} - name: PR Comment - if: failure() && steps.create-pr.outputs.pull-request-number + if: ${{ success() && steps.cherry-pick.outcome == 'failure' }} uses: actions/github-script@v2 with: github-token: ${{ secrets.CHERRY_PICK_TOKEN }}