Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gh action #10

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/enforcer.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
name: Enforce branch rules
name: Enforce branch workflow

on:
pull_request:
branches:
- main

jobs:
check_branch_main:
job_enforce_main:
runs-on: ubuntu-latest
steps:
- name: Check Branch main
- name: Enforce main
if: github.base_ref == 'main' && !(startsWith(github.head_ref, 'develop') || startsWith(github.head_ref, 'hotfix/'))
run: |
if [[ "${{ github.head_ref }}" != "develop" && ! "${{ github.head_ref }}" =~ ^hotfix/ ]]; then
echo "ERROR: You can only merge to main from develop or hotfix/*."
exit 1
fi
echo "ERROR: You can only merge to main from develop or hotfix/**"
exit 1
21 changes: 21 additions & 0 deletions .github/workflows/hotfix-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Merge "hotfix/**" into "main" and "develop"

on:
pull_request:
branches:
- hotfix/**
types:
- closed

jobs:
merge_hotfix_into_main_and_develop:
runs-on: ubuntu-latest
steps:
- name: Merge hotfix into main and develop
run: |
git checkout main
git merge --no-ff origin/hotfix
git push origin main
git checkout develop
git merge --no-ff origin/hotfix
git push origin develop