Skip to content

Commit

Permalink
Update action
Browse files Browse the repository at this point in the history
  • Loading branch information
sgfn committed Aug 8, 2023
1 parent ec22862 commit 7e4bbcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/enforce-pr-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
uses: actions/checkout@v3
- name: Check PR
run: |
PR_BASE=$(gh pr view https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} --json base -q ".base.ref")
PR_HEAD=$(gh pr.view https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} --json head -q ".head.ref")
PR_BASE=$(gh pr view https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} --json baseRefName -q ".base.ref")
PR_HEAD=$(gh pr view https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} --json headRefName -q ".head.ref")
if [[ "$PR_BASE" == "main" ]] && ! [[ "$PR_HEAD" =~ ^dev$|^fix/ ]]; then
echo 'PRs to branch `main` can only come from branch `dev` or any branch prefixed with `fix/`'
exit 1
Expand Down

0 comments on commit 7e4bbcb

Please sign in to comment.