Raise unhandled error on arg mismatch #1093
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Git tree checks | |
on: | |
pull_request: | |
types: [opened, edited, reopened, synchronize] | |
permissions: | |
pull-requests: write | |
contents: read | |
jobs: | |
check_base_ref: | |
name: Release branch restriction | |
runs-on: ubuntu-latest | |
steps: | |
- name: Change base to master if needed | |
if: | | |
github.event_name == 'pull_request' && | |
github.event.pull_request.base.ref == 'release/latest' && | |
! startsWith(github.event.pull_request.head.ref, 'release/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo 'Updating PR '"#${{ github.event.pull_request.number }}"' to use base `master`' | |
echo 'If you do want to release your changes directly by merging into `release/latest`, your branch must start with `release/`.' | |
curl -X PATCH \ | |
-H "Authorization: Bearer $GITHUB_TOKEN" \ | |
-H "Accept: application/vnd.github+json" \ | |
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} \ | |
-d '{"base": "master"}' |