-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7eca084
commit 35e2738
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Create Release Branch on PR Merge | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
create_release_branch: | ||
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'release' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Git | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
- name: Create release branch if not exists | ||
run: | | ||
git fetch origin | ||
if ! git show-ref --verify --quiet refs/heads/release; then | ||
git checkout -b release | ||
git push origin release | ||
fi | ||
- name: Merge pull request into release branch | ||
run: | | ||
git checkout release | ||
git merge --no-ff ${{ github.event.pull_request.head.ref }} | ||
git push origin release |