Repository navigation
Release: merge release into main #4
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: Main source guard | |
| # Make the job "only-release-into-main" a required status check on main. | |
| on: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, reopened, synchronize, edited] | |
| permissions: | |
| contents: read | |
| jobs: | |
| only-release-into-main: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Require head branch "release" | |
| env: | |
| HEAD_REF: ${{ github.head_ref }} | |
| HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} | |
| run: | | |
| if [ "$HEAD_REF" != "release" ] || [ "$HEAD_REPO" != "${{ github.repository }}" ]; then | |
| echo "::error::PRs into main must come from the release branch of this repository (got '$HEAD_REPO:$HEAD_REF')." | |
| exit 1 | |
| fi |