[main] 병합 X #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main_merge_test | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] | |
branches: ["main"] | |
jobs: | |
check_is_valid_main_merge_branch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if the branch name is valid for main merge | |
if: ${{ contains(github.head_ref,'merge-dev') || (github.head_ref != 'release' && !contains(github.head_ref,'/main') && !contains(github.head_ref,'hotfix')) }} | |
run: | | |
echo "Branch ${{ github.head_ref }} is not valid to merge to 'main'. Only 'release' branch or branches with '/main' or 'hotfix' are allowed to merge to 'main'." | |
exit 1 | |
check_is_label_main: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if label name is main | |
if: ${{ !contains(github.event.pull_request.labels.*.name,'production') }} | |
run: | | |
echo "This PR is not valid to merge develeop. Only PR with 'production' label is allowed to merge to 'main'." | |
exit 1 |