Skip to content

merging 5832/5851/5854/5856/5859/5863/5864/5866/5867/5869/5870/5871/5872/5874/5875/5876/5877/5878 to prod #3820

merging 5832/5851/5854/5856/5859/5863/5864/5866/5867/5869/5870/5871/5872/5874/5875/5876/5877/5878 to prod

merging 5832/5851/5854/5856/5859/5863/5864/5866/5867/5869/5870/5871/5872/5874/5875/5876/5877/5878 to prod #3820

name: Only allow staging -> prod & !prod -> staging merges
on:
pull_request:
branches:
- staging
- prod
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Only allow staging -> prod merges
run: |
# All branches *except* prod can be merged into staging
# *Only* staging can be merged into prod
echo "Merging ${GITHUB_HEAD_REF} into ${GITHUB_BASE_REF}"
python3 -c 'import os, sys; sys.exit(not(os.environ["GITHUB_HEAD_REF"] == "staging" if os.environ["GITHUB_BASE_REF"] == "prod" else os.environ["GITHUB_HEAD_REF"] != "prod"))'