From 0b9be0674521b1dc8ff14de52260306c413380f5 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sat, 3 Feb 2024 16:12:55 +0100 Subject: [PATCH] MDL-77166 core: Auto close pull requests @ GitHub Note that we have also enabled it to be executed via manual dispatch to be able to close currently existing PRs. Once everything existing is closed, it will take on any new PR arriving. Then, we can remove the manual dispatching, although it's not critical to leave it there in case we want to use that workflow with other repos. --- .github/workflows/close-pull-requests.yml | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/close-pull-requests.yml diff --git a/.github/workflows/close-pull-requests.yml b/.github/workflows/close-pull-requests.yml new file mode 100644 index 00000000000..5ef42b152fa --- /dev/null +++ b/.github/workflows/close-pull-requests.yml @@ -0,0 +1,30 @@ +name: 'Close Pull Requests' + +on: + pull_request_target: + types: opened + workflow_dispatch: + +jobs: + close: + # Avoid forks to run this job + if: github.repository_owner == 'moodlehq' + name: Close Pull Requests + runs-on: ubuntu-latest + steps: + - uses: dessant/repo-lockdown@v4 + with: + process-only: prs + close-pr: true + pr-comment: > + **Please, don't open pull requests via GitHub.** + + + This repository (moodle.git) at GitHub is just a mirror of the official Moodle repository. + + + For how to contribute patches for Moodle see + [CONTRIBUTING.txt](https://github.com/moodle/moodle/blob/main/CONTRIBUTING.txt). + + + Closing this pull request.