-
Notifications
You must be signed in to change notification settings - Fork 38
39 lines (36 loc) · 1.08 KB
/
close-prs.yml
File metadata and controls
39 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
name: Close Pull Requests
on:
pull_request_target:
types: [opened]
branches:
- '**'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Acknowledge PR
run: echo "Received a new PR. Proceeding to close."
close:
runs-on: ubuntu-latest
needs: validate
permissions:
pull-requests: write
steps:
- name: Close Pull Request
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: 'Thanks for your contribution, however QUADS utilizes Gerrit code review and does not utilize pull requests. See the CONTRIBUTING.md file for more information.'
});
github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
state: 'closed'
});