Skip to content

Commit

Permalink
build: create release branch workflow fix (#1262)
Browse files Browse the repository at this point in the history
  • Loading branch information
chillleader authored Oct 10, 2023
1 parent 472040d commit 68fedb9
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/CREATE_RELEASE_BRANCH.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,20 @@ jobs:
distribution: 'temurin'
java-version: '17'

- name: Configure git user
run: |
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create branch
id: create-branch
run: |
MINOR_VERSION=${RELEASE_VERSION%.*}
git checkout -b release/${MINOR_VERSION}
git push --set-upstream origin release/${MINOR_VERSION}
echo "branchName=release/${RELEASE_VERSION%.*}" >> $GITHUB_OUTPUT
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}

- name: Set snapshot version on release branch
id: set-snapshot-version
run: |
MINOR_VERSION=${RELEASE_VERSION%.*}
git checkout release/${MINOR_VERSION}
mvn -B versions:set -DnewVersion=${RELEASE_VERSION}-SNAPSHOT -DgenerateBackupPoms=false -f parent
echo "branchName=release/${RELEASE_VERSION%.*}" >> $GITHUB_OUTPUT
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}

- name: Create pull request to main branch
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.create-branch.outputs.branchName }}
branch: ${{ steps.set-snapshot-version.outputs.branchName }}
commit-message: "ci: set next snapshot version"
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
base: main
Expand Down

0 comments on commit 68fedb9

Please sign in to comment.