From 75fd006de67f252eb89c0c5306cc0a1ba2287988 Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Thu, 3 Dec 2020 07:56:23 -0800 Subject: [PATCH] Close unwanted pull requests (#16679) * Close unwanted pull requests * Update close-unwanted-pull-requests.yml * List out files excluded --- .../close-unwanted-pull-requests.yml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/close-unwanted-pull-requests.yml diff --git a/.github/workflows/close-unwanted-pull-requests.yml b/.github/workflows/close-unwanted-pull-requests.yml new file mode 100644 index 0000000000..e71c0e1221 --- /dev/null +++ b/.github/workflows/close-unwanted-pull-requests.yml @@ -0,0 +1,39 @@ +name: Close unwanted pull requests +on: + pull_request: + paths: + - '.github/workflows/**' + - '.github/CODEOWNERS' + - 'translations/**' + - 'assets/fonts/**' + - 'data/graphql/**' + - 'lib/graphql/**' + - 'lib/redirects/**' + - 'lib/webhooks/**' +jobs: + close_unwanted_pull_requests: + if: github.repository == 'github/docs' + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + with: + script: | + await github.issues.createComment({ + ...context.repo, + issue_number: context.payload.pull_request.number, + body: + `Thanks for contributing! We do not accept community changes to these files at this time. + - '.github/workflows/**' + - '.github/CODEOWNERS' + - 'translations/**' + - 'assets/fonts/**' + - 'data/graphql/**' + - 'lib/graphql/**' + - 'lib/redirects/**' + - 'lib/webhooks/**'` + }) + await github.issues.update({ + ...context.repo, + issue_number: context.payload.pull_request.number, + state: 'closed' + })