Skip to content

Commit

Permalink
[github workflow] auto-close PR's with branch named 'master' (betafli…
Browse files Browse the repository at this point in the history
…ght#433)

* [github workflow] auto-close PR's with branch named 'master'

* [github workflow] auto-close PR's with branch named 'master'; remove branch specifiers
  • Loading branch information
nerdCopter authored Jun 17, 2024
1 parent 04d449b commit f60b117
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/auto-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Auto close bad PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on:
pull_request_target:

permissions:
pull-requests: write
issues: write

jobs:
close-pr:
runs-on: ubuntu-22.04
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: autoclose
shell: bash
if: github.head_ref == 'master'
run: gh pr close ${{github.event.pull_request.number}} --comment "Auto-closing pull request because the source branch is named 'master'. Please create a feature branch instead. https://betaflight.com/docs/development#using-git-and-github"

0 comments on commit f60b117

Please sign in to comment.