Skip to content

Commit

Permalink
Update create_release.yml (#2018)
Browse files Browse the repository at this point in the history
# Summary
- Release script checks for release branch and skips steps instead of
failing

# Ticket

<ticket>
COIOS-000
</ticket>
  • Loading branch information
goergisn authored Feb 19, 2025
1 parent 43df01f commit 248c34d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,28 @@ jobs:
fetch-depth: 0

- name: Fetch Pull Request Details
continue-on-error: true
run: |
SOURCE_BRANCH=${{ github.event.pull_request.head.ref }}
# Checking if the source branch was a release
# If the branch is not a release branch we return early and skip the subsequent steps
if [[ "$SOURCE_BRANCH" != release/* ]]; then
echo "PROCEED=false" >> $GITHUB_ENV
echo "Source branch does not match pattern. Exiting."
exit 1
echo "IS_RELEASE_BRANCH=false" >> $GITHUB_ENV
exit 0
fi
# Extracting the version number from the source branch name
# If the version number does not match we fail to indicate an issue
VERSION_NUMBER=${SOURCE_BRANCH#release/}
if [[ ! "$VERSION_NUMBER" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "'$VERSION_NUMBER' does not match semantic versioning format. Exiting."
exit 1
fi
echo "IS_RELEASE_BRANCH=true" >> $GITHUB_ENV
MERGE_COMMIT_SHA=${{ github.event.pull_request.merge_commit_sha }}
PR_NUMBER=${{ github.event.pull_request.number }}
Expand All @@ -49,6 +56,7 @@ jobs:
echo "$PR_BODY" >> "${{ github.workspace }}/release_content.md"
- name: Create Release
if: env.IS_RELEASE_BRANCH == 'true'
uses: softprops/action-gh-release@v2
with:
body_path: "${{ github.workspace }}/release_content.md"
Expand Down

0 comments on commit 248c34d

Please sign in to comment.