nvim/pack/acp/opt/nvim-lspconfig/.github/workflows/feature-branch-check.yml

29 lines
733 B
YAML
Raw Normal View History

2022-01-10 11:08:46 +00:00
name: Close Non-Feature Branches
on:
pull_request_target:
branches:
- master
jobs:
close-master-branch:
runs-on: ubuntu-latest
permissions:
pull-requests: write
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Close if master branch
if: ${{ github.head_ref == 'master' }}
run: |
gh pr close $PR_NUMBER
gh pr comment $PR_NUMBER --body "This pull request has been automatically closed. Please develop on a feature branch. Thank you."
exit 1