File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77jobs :
88 create_release :
9- if : github.event.pull_request.merged == true
9+ if : github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
1010 name : " Create Release"
1111 runs-on : ubuntu-latest
1212
@@ -20,24 +20,13 @@ jobs:
2020 run : |
2121 SOURCE_BRANCH=${{ github.event.pull_request.head.ref }}
2222
23- # Checking if the source branch was a release
24- # If the branch is not a release branch we return early and skip the subsequent steps
25- if [[ "$SOURCE_BRANCH" != release/* ]]; then
26- echo "PROCEED=false" >> $GITHUB_ENV
27- echo "Source branch does not match pattern. Exiting."
28- echo "IS_RELEASE_BRANCH=false" >> $GITHUB_ENV
29- exit 0
30- fi
31-
3223 # Extracting the version number from the source branch name
3324 # If the version number does not match we fail to indicate an issue
3425 VERSION_NUMBER=${SOURCE_BRANCH#release/}
3526 if [[ ! "$VERSION_NUMBER" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
3627 echo "'$VERSION_NUMBER' does not match semantic versioning format. Exiting."
3728 exit 1
3829 fi
39-
40- echo "IS_RELEASE_BRANCH=true" >> $GITHUB_ENV
4130
4231 MERGE_COMMIT_SHA=${{ github.event.pull_request.merge_commit_sha }}
4332 PR_NUMBER=${{ github.event.pull_request.number }}
5645 echo "$PR_BODY" >> "${{ github.workspace }}/release_content.md"
5746
5847 - name : Create Release
59- if : env.IS_RELEASE_BRANCH == 'true'
6048 uses : softprops/action-gh-release@v2
6149 with :
6250 body_path : " ${{ github.workspace }}/release_content.md"
You can’t perform that action at this time.
0 commit comments