Bug 1847997: Automatically close GitHub pull requests with a GitHub Action r=hwine DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D185836
This commit is contained in:
glob 2023-08-10 17:01:59 +00:00
parent d7740874a5
commit 774d6c8538
2 changed files with 24 additions and 0 deletions

7
.github/workflows/README vendored Normal file
View File

@ -0,0 +1,7 @@
IMPORTANT
All changes and/or additions to GitHub Workflows MUST be approved by the
Mozilla GitHub Enterprise Administrators Team.
See https://mozilla-hub.atlassian.net/l/cp/f5ypVsa7 for contact information, or
reach out on Matrix: https://chat.mozilla.org/#/room/#github-admin:mozilla.org

17
.github/workflows/close-pr.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: close pull request
on:
pull_request:
types: [opened, reopened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: close
env:
GH_TOKEN: ${{ github.token }}
run: |
PR=$(echo "$GITHUB_REF" | awk 'BEGIN { FS = "/" } ; { print $3 }')
gh pr close $PR --comment "(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html"
gh pr lock $PR