min google perms #114
Workflow file for this run
This file contains 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: "require PRs to be merged via 'rc-*' branches" | |
on: | |
pull_request: | |
types: [opened, edited, synchronize] | |
jobs: | |
check-branch-name: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check that PR's base branch is an 'rc-' branch, unless the head branch is an 'rc-' branch | |
run: | | |
BASE_BRANCH="${{ github.event.pull_request.base.ref }}" | |
HEAD_BRANCH="${{ github.event.pull_request.head.ref }}" | |
# Check if base branch starts with 'rc-' | |
if [[ "$BASE_BRANCH" != rc-* && "$HEAD_BRANCH" != rc-* ]]; then | |
echo "Error: The base branch '$BASE_BRANCH' is not an 'rc-' branch; and the head branch '$HEAD_BRANCH' is not an 'rc-' branch." | |
exit 1 | |
fi |