Skip to content

Commit

Permalink
fix: handle staging branch
Browse files Browse the repository at this point in the history
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
  • Loading branch information
AgustinRamiroDiaz committed Aug 29, 2024
1 parent 7076ac7 commit d969693
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/only-merge-release-branches-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@ on:
types: [opened, synchronize, reopened, edited]
branches:
- main
- staging

jobs:
validate-pr-source-branch:
runs-on: ubuntu-latest
steps:
- name: Check if source branch is a release branch
run: |
if [[ ${{ github.event.pull_request.base.ref }} == "staging" ]]; then
echo "Target branch is staging"
exit 0
fi
if [[ ${{ github.event.pull_request.head.ref }} =~ ^release/.*$ ]]; then
echo "Source branch is a release branch"
exit 0
echo "Source branch is a release branch"
exit 0
else
echo "Source branch is not a release branch"
exit 1
echo "Source branch is not a release branch"
exit 1
fi

0 comments on commit d969693

Please sign in to comment.