From 1e573b9e461bd9795993332d5cad3cecf51cc7eb Mon Sep 17 00:00:00 2001 From: Sherry Wong Date: Tue, 15 Oct 2024 11:49:08 +0200 Subject: [PATCH 1/2] add workflow to auto close stale pr --- .github/workflows/close-stale-pr.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/close-stale-pr.yml diff --git a/.github/workflows/close-stale-pr.yml b/.github/workflows/close-stale-pr.yml new file mode 100644 index 00000000000..8c95fda3669 --- /dev/null +++ b/.github/workflows/close-stale-pr.yml @@ -0,0 +1,18 @@ +name: Close stale PR +on: + pull_request: + types: labeled +jobs: + test-action: + 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. From 31a3390ee797404e5357e0ca5465ec5f1b13ea69 Mon Sep 17 00:00:00 2001 From: Sherry Wong Date: Tue, 15 Oct 2024 11:51:59 +0200 Subject: [PATCH 2/2] update action name --- .github/workflows/close-stale-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close-stale-pr.yml b/.github/workflows/close-stale-pr.yml index 8c95fda3669..43a213adc17 100644 --- a/.github/workflows/close-stale-pr.yml +++ b/.github/workflows/close-stale-pr.yml @@ -3,7 +3,7 @@ on: pull_request: types: labeled jobs: - test-action: + close-pr: if: github.event.label.name == 'stale-pr' permissions: pull-requests: write