name: Prevent prod to staging merges

on:
  pull_request:
    branches: staging

jobs:
  check-branch:
    runs-on: ubuntu-latest
    steps:
    - name: Fail if we are merging prod to staging
      run: |
        env
        echo $GITHUB_REF | grep -v prod
        cat $GITHUB_EVENT_PATH
name: Prevent prod to staging merges

on:
  pull_request:
    branches: staging

jobs:
  check-branch:
    runs-on: ubuntu-latest
    steps:
    - name: Fail if we are merging prod to staging
      run: |
        echo $GITHUB_HEAD_REF | grep -v prod
Use $GITHUB_HEAD_REF instead of $GITHUB_REF
ci: Use $GITHUB_HEAD_REF instead of $GITHUB_REF

seems to properly refer to the name of branch that
is being merged.
