Skip to content

Commit

Permalink
check whether PR into main is from staging
Browse files Browse the repository at this point in the history
  • Loading branch information
gretzke committed Nov 8, 2023
1 parent d98b6a1 commit d51791f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Source branch check
on:
pull_request:
branches: [main]
types:
- opened
- reopened
- synchronize
- edited
jobs:
check-main:
if: github.base_ref == 'main'
runs-on: ubuntu-latest
steps:
- name: Check branches
run: |
if [ ${{ github.head_ref }} != "staging" ]; then
echo "Merge requests to main branch are only allowed from staging branch."
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: pre-commit
on:
pull_request:
branches: [master, staging, dev, feat/**, fix/**]
branches: [main, master, staging, dev, feat/**, fix/**]

jobs:
pre-commit:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: test

on:
pull_request:
branches: [master, staging, dev, feat/**, fix/**]
branches: [main, master, staging, dev, feat/**, fix/**]

env:
FOUNDRY_PROFILE: ci
Expand Down

0 comments on commit d51791f

Please sign in to comment.