Skip to content

Commit

Permalink
validate pr refs
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Jan 17, 2024
1 parent ac60097 commit f35a6a2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/validate-pull-request-refs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Validate Pull Request Refs

on:
workflow_call:

jobs:
validate-pr-refs:
runs-on: ubuntu-latest
env:
PROD_REF: production
STAGING_REF: staging
DEV_REF: development
steps:
- name: Merge into "${{ env.STAGING_REF }}" from "${{ env.DEV_REF }}"
if: github.event.pull_request.base.ref == env.STAGING_REF
run: if [ ${{ github.event.pull_request.head.ref }} != ${{ env.DEV_REF }} ]; then exit 1; fi

- name: Merge into "${{ env.PROD_REF }}" from "${{ env.STAGING_REF }}"
if: github.event.pull_request.base.ref == env.PROD_REF
run: if [ ${{ github.event.pull_request.head.ref }} != ${{ env.STAGING_REF }} ]; then exit 1; fi

0 comments on commit f35a6a2

Please sign in to comment.