diff --git a/.github/workflows/make-pr-ready-for-review.yaml b/.github/workflows/make-pr-ready-for-review.yaml index 5fc0967248..619c07c59f 100644 --- a/.github/workflows/make-pr-ready-for-review.yaml +++ b/.github/workflows/make-pr-ready-for-review.yaml @@ -1,7 +1,7 @@ -name: PR Ready for Review on Label Removal +name: Mark PR as Ready When Conflicts Label is Removed on: - pull_request: + pull_request_target: types: - unlabeled @@ -10,29 +10,13 @@ env: jobs: mark-ready: + if: github.event.label.name == 'conflicts' runs-on: ubuntu-latest permissions: pull-requests: write steps: - - name: Check if specific label was removed - id: check-label - run: | - if [[ "${{ github.event.label.name }}" == "conflicts" ]]; then - echo "The removed label is conflicts." - echo "removed_conflicts=true" >> $GITHUB_OUTPUT - fi - - - name: Checkout repository - uses: actions/checkout@v4 - with: - repository: ${{ github.repository }} - ref: ${{ env.DEFAULT_BRANCH }} - token: ${{ secrets.AUTO_BACKPORT_TOKEN }} - fetch-depth: 1 - - name: Mark pull request as ready for review - if: steps.check-label.outputs.removed_conflicts == 'true' run: gh pr ready "${{ github.event.pull_request.number }}" env: GITHUB_TOKEN: ${{ secrets.AUTO_BACKPORT_TOKEN }}