Skip to content

Commit 15eb56b

Browse files
Merge pull request #1374 from jistr/f/auto-close-downstream-prs
Automatically close PRs against the downstream branch
2 parents c76f080 + 6cc526c commit 15eb56b

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Close pull requests to downstream branch
2+
3+
on: # yamllint disable-line rule:truthy
4+
pull_request_target:
5+
branches:
6+
- downstream
7+
types: [opened, reopened]
8+
9+
jobs:
10+
auto-close-downstream-pr:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
14+
steps:
15+
- name: Comment and close PR
16+
env:
17+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
run: |
19+
gh pr comment ${{ github.event.pull_request.number }} \
20+
--repo ${{ github.event.repository.name }} \
21+
--body "The \`downstream\` branch is managed via automation. Please open pull requests against the \`main\` branch and backports against an FR branch. This PR has been automatically closed."
22+
gh pr close ${{ github.event.pull_request.number }} \
23+
--repo ${{ github.event.repository.name }}

0 commit comments

Comments
 (0)