From 180764c981cc21fdacdf0e804cb958915ab9652d Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Tue, 28 May 2024 10:24:14 +0200 Subject: [PATCH] Fix: Replace defunct Probot with GitHub Action workflow to auto-close PRs The Probot configuration we previously used to auto-close PRs (and Issues) on GitHub is no longer functioning. To address this, I've created a GitHub Actions workflow that performs the same task. This workflow is triggered whenever a pull request is created. With the current setup, pull requests are marked as stale immediately (0 days) and are subsequently closed right away (0 days). Pull Request: https://projects.blender.org/blender/blender/pulls/122299 --- .github/stale.yml | 21 --------------------- .github/workflows/stale.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 21 deletions(-) delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 2b7adb5176e..00000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale -# This file is used on Blender's GitHub mirror to automatically close any pull request -# and invite contributors to join the official development platform on blender.org - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 1 - -# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 1 - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This issue has been automatically closed, because this repository is only - used as a mirror. Blender development happens on projects.blender.org. - - To get started contributing code, please read: - https://developer.blender.org/docs/handbook/contributing/ diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000000..13370206324 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,32 @@ +# GitHub Actions workflow for automatically closing pull requests +# This workflow is specific to Blender's GitHub mirror and directs contributors to the official development platform on blender.org + +name: Close GitHub Pull Requests + +# Trigger this Action when a pull request is opened. +on: + pull_request: + types: [opened] + +jobs: + close_prs: + name: Close Pull Requests + runs-on: ubuntu-latest + # Only run this job in the read-only mirror repository. + if: github.repository == 'blender/blender' && contains(github.server_url, 'github.com') + # Permissions granted to the GitHub Actions bot. + permissions: + pull-requests: write + steps: + - uses: actions/stale@v9 + with: + # Number of days before a pull request is marked as stale. + days-before-pr-stale: 0 + # Number of days before a pull request is closed. + days-before-pr-close: 0 + # Message posted when closing a pull request. + stale-pr-message: | + This pull request has been automatically closed because this repository is a read-only mirror. Blender development happens on [projects.blender.org](https://projects.blender.org). + + To contribute code, please read: + https://developer.blender.org/docs/handbook/contributing/