Skip to content

Commit 714efd8

Browse files
committed
Improve spring-cut-release-branch.yml
* Add step to create GH milestone for the release version if one does not exist * Fail the workflow if release branch already exists
1 parent c0e92dc commit 714efd8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/spring-cut-release-branch.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ jobs:
3232
VERSION: ${{ steps.compute-version.outputs.version }}
3333
run: echo "version=${VERSION%-SNAPSHOT}" >> "$GITHUB_OUTPUT"
3434

35+
- name: Check Release Branch Does Not Exist
36+
env:
37+
RELEASE_VERSION: ${{ steps.compute-release-version.outputs.version }}
38+
run: |
39+
if git ls-remote --exit-code --heads origin release/$RELEASE_VERSION
40+
then
41+
echo "::error title=Cannot cut release branch::Branch release/$RELEASE_VERSION already exists"
42+
exit 1
43+
fi
44+
45+
- name: Create Milestone
46+
env:
47+
RELEASE_VERSION: ${{ steps.compute-release-version.outputs.version }}
48+
run: gh api repos/$GITHUB_REPOSITORY/milestones -f title=$RELEASE_VERSION || true
49+
3550
- name: Create Release Branch
3651
env:
3752
RELEASE_VERSION: ${{ steps.compute-release-version.outputs.version }}

0 commit comments

Comments
 (0)