Skip to content

Commit

Permalink
chore: Prevent PRs targetting the master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Sep 25, 2024
1 parent 5dbbb1d commit 8d58e86
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/pr-base-enforcement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Prevent PRs targetting master

on:
pull_request:
branches:
- master

jobs:
prevent-pr-targetting-master:
runs-on: ubuntu-latest
steps:
- name: Post comment to update base branch
run: gh pr comment ${{ github.event.pull_request.number }} --body "⚠️ Pull requests targetting the `master` branch are not allowed. Please update the base branch to `next`."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Close PR
run: gh pr close ${{ github.event.pull_request.number }} --repo ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8d58e86

Please sign in to comment.