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!