Skip to content

chore: Prevent PRs targetting the master branch #1

chore: Prevent PRs targetting the master branch

chore: Prevent PRs targetting the master branch #1

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 }}