Skip to content

chore: Prevent PRs targetting the master branch #4

chore: Prevent PRs targetting the master branch

chore: Prevent PRs targetting the master branch #4

name: Prevent PRs targetting master
on:
pull_request:
branches:
- master
jobs:
prevent-pr-targetting-master:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- 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 }}