diff --git a/.github/workflows/make-pr-ready-for-review.yaml b/.github/workflows/make-pr-ready-for-review.yaml new file mode 100644 index 0000000000..3c93e2bffa --- /dev/null +++ b/.github/workflows/make-pr-ready-for-review.yaml @@ -0,0 +1,36 @@ +name: PR Ready for Review on Label Removal + +on: + pull_request: + types: + - unlabeled + +env: + DEFAULT_BRANCH: 'master' + +jobs: + mark-ready: + runs-on: ubuntu-latest + + 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 }}