From 3ff273dc87f5136e141c8530e89f6f5d40d98de5 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Tue, 24 Sep 2024 12:59:21 -0400 Subject: [PATCH] build: add job to close PR due to it being stale --- .github/workflows/autoclose.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/autoclose.yml b/.github/workflows/autoclose.yml index 78850dea28a..4d6df813918 100644 --- a/.github/workflows/autoclose.yml +++ b/.github/workflows/autoclose.yml @@ -179,3 +179,35 @@ jobs: GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.pull_request.number }} + + # Define a job which closes a pull request if a pull request is considered stale: + stale: + + # Define job name: + name: 'Check for stale label' + + # Only run this job if the pull request has a specific label: + if: "${{ github.event.label.name == 'autoclose: Stale' }}" + + # Define job permissions: + permissions: + contents: read + issues: write + pull-requests: write + + # Define the type of virtual host machine: + runs-on: ubuntu-latest + + # Define the sequence of job steps: + steps: + # Close the pull request: + - name: 'Close pull request' + run: gh pr close "$NUMBER" --comment "$BODY" + env: + GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.pull_request.number }} + BODY: | + This pull request has been automatically closed because it has been inactive for an extended period after changes were requested. If you still wish to pursue this contribution, feel free to reopen the pull request or submit a new one. + + We appreciate your interest in contributing to stdlib!