Skip to content

Merge branch 'hotfix/1.0.1-rc.4' into develop #11

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

Merged
merged 3 commits into from
Feb 13, 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
36 changes: 19 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ name: release

on:
pull_request:
branches:
- main
types:
- closed
branches:
- main

env:
BRANCH_MAIN: main
BRANCH_DEVELOP: develop
BRANCH_RELEASE_PREFIX: release
BRANCH_HOTFIX_PREFIX: hotfix
TAG_PREFIX: v

jobs:
Expand All @@ -20,7 +22,7 @@ jobs:
contents: write
# only merge pull requests that begin with 'release/' or 'hotfix/'
if: github.event.pull_request.merged == true &&
(startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix/'))
(startsWith(github.head_ref, '${{ env.BRANCH_RELEASE_PREFIX }}/') || startsWith(github.head_ref, '${{ env.BRANCH_HOTFIX_PREFIX }}/'))

steps:
- name: Set GitHub token
Expand All @@ -30,21 +32,21 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
ref: ${{ github.head_ref }}
token: ${{ env.GH_TOKEN }}

- name: Extract version from release branch
if: startsWith(github.event.pull_request.head.ref, 'release/')
if: startsWith(github.head_ref, '${{ env.BRANCH_RELEASE_PREFIX }}/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#release/}
BRANCH_NAME="${{ github.head_ref }}"
VERSION=${BRANCH_NAME#${{ env.BRANCH_RELEASE_PREFIX }}/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV

- name: Extract version from hotfix branch
if: startsWith(github.event.pull_request.head.ref, 'hotfix/')
if: startsWith(github.head_ref, '${{ env.BRANCH_HOTFIX_PREFIX }}/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix/}
BRANCH_NAME="${{ github.head_ref }}"
VERSION=${BRANCH_NAME#${{ env.BRANCH_HOTFIX_PREFIX }}/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV

- name: Create release
Expand All @@ -57,18 +59,18 @@ jobs:
--title "${{ env.RELEASE_TAG }}" \
--generate-notes

- name: Create merge PR ${{ github.event.pull_request.head.ref }} -> ${{ env.BRANCH_DEVELOP }}
- name: Create merge PR ${{ github.head_ref }} -> ${{ env.BRANCH_DEVELOP }}
env:
PR_TITLE: Merge branch '${{ github.event.pull_request.head.ref }}' into ${{ env.BRANCH_DEVELOP }}
PR_TITLE: Merge branch '${{ github.head_ref }}' into ${{ env.BRANCH_DEVELOP }}
PR_BODY: |
This PR merges the ${{ github.event.pull_request.head.ref }} branch back into ${{ env.BRANCH_DEVELOP }} branch.
This happens to ensure that the updates that happened on the ${{ github.event.pull_request.head.ref }} branch, i.e. CHANGELOG and manifest updates are also present on the ${{ env.BRANCH_DEVELOP }} branch.
PR_LABELS: |
automated-pr
This PR merges the ${{ github.head_ref }} branch back into ${{ env.BRANCH_DEVELOP }} branch.
This happens to ensure that the updates that happened on the ${{ github.head_ref }} branch, i.e. CHANGELOG and manifest updates are also present on the ${{ env.BRANCH_DEVELOP }} branch.
PR_LABEL: automated-pr
run: |
gh label create ${{ env.PR_LABEL }} --force
gh pr create \
--base ${{ env.BRANCH_DEVELOP }} \
--head ${{ github.event.pull_request.head.ref }} \
--head ${{ github.head_ref }} \
--title "${{ env.PR_TITLE }}" \
--body "${{ env.PR_BODY }}" \
--label "${{ env.PR_LABEL }}" \
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.0.1-rc.4](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.3...v1.0.1-rc.4) (2023-02-12)


### Bug Fixes

* **github-actions:** fix fail steps and refactor code ([872d740](https://github.com/ansidev/sample-gitflow-release-workflows/commit/872d740b98dd15adc988079744656814229f37d5))

### [1.0.1-rc.3](https://github.com/ansidev/sample-gitflow-release-workflows/compare/v1.0.1-rc.2...v1.0.1-rc.3) (2023-02-12)


Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1-rc.3
1.0.1-rc.4