This repository was archived by the owner on Jul 20, 2026. It is now read-only.
Filter and sort products #31
Workflow file for this run
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: Restrict merge source | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| - dev | |
| - docs | |
| jobs: | |
| check-source-branch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check that PR source is 'dev' | |
| run: | | |
| if [ "${{ github.base_ref }}" == "master" ]; then | |
| if [ "${{ github.head_ref }}" != "dev" ] && [ "${{ github.head_ref }}" != "docs" ]; then | |
| echo "PRs to master are only allowed from the 'dev' or 'docs' branch." | |
| echo "Source branch was: ${{ github.head_ref }}" | |
| exit 1 | |
| fi | |
| fi | |
| if [ "${{ github.base_ref }}" == "dev" ] && [ "${{ github.head_ref }}" == "master" ]; then | |
| echo "Merges from 'master' to 'dev' are not allowed." | |
| exit 1 | |
| fi | |
| if [ "${{ github.base_ref }}" == "docs" ]; then | |
| echo "No merges are allowed onto 'docs'." | |
| exit 1 | |
| fi | |
| if [ "${{ github.head_ref }}" == "docs" ] && [ "${{ github.base_ref }}" != "master" ]; then | |
| echo "'docs' can only be merged into 'master'." | |
| echo "Target branch was: ${{ github.base_ref }}" | |
| exit 1 | |
| fi | |
| echo "Source branch is allowed. Proceeding." |