Skip to content

Raise unhandled error on arg mismatch #1093

Raise unhandled error on arg mismatch

Raise unhandled error on arg mismatch #1093

Workflow file for this run

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