diff --git a/.github/workflows/close-stale-pr.yml b/.github/workflows/close-stale-pr.yml new file mode 100644 index 00000000000..43a213adc17 --- /dev/null +++ b/.github/workflows/close-stale-pr.yml @@ -0,0 +1,18 @@ +name: Close stale PR +on: + pull_request: + types: labeled +jobs: + close-pr: + if: github.event.label.name == 'stale-pr' + permissions: + pull-requests: write + runs-on: ubuntu-latest + steps: + - run: gh pr close "$NUMBER" --comment "$COMMENT" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.number }} + COMMENT: > + Closing this PR due to staleness! If there are new updates, please reopen the PR.