Skip to content

Commit

Permalink
better handle multi-line notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Feb 27, 2025
1 parent cc6a79c commit 4282eaa
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,22 @@ jobs:
if: github.event_name == 'release'
id: get_release_info
run: |
RELEASE_VERSION=${{ github.event.release.tag_name }}
RELEASE_NOTES="${{ github.event.release.body }}"
RELEASE_VERSION="${{ github.event.release.tag_name }}"
if [ -z "$RELEASE_VERSION" ]; then
echo "Error: RELEASE_VERSION is empty. Ensure a valid release tag."
exit 1
fi
# Escape special characters for safe writing to file
RELEASE_NOTES=$(echo "$RELEASE_NOTES" | sed 's/"/\\"/g')
echo "VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
echo "RELEASE_NOTES=\"$RELEASE_NOTES\"" >> $GITHUB_ENV
echo "VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
# Correct way to store multi-line release notes in GITHUB_ENV
{
echo "RELEASE_NOTES<<EOF"
echo "${{ github.event.release.body }}"
echo "EOF"
} >> $GITHUB_ENV
- name: Update version.py (only on release)
if: github.event_name == 'release'
run: |
Expand All @@ -71,7 +73,7 @@ jobs:
# Create version.py if it doesn't exist
if [ ! -f "$VERSION_FILE" ]; then
echo "# Version Information" > "$VERSION_FILE"
echo "__version__ = \"0.0.0\"" > "$VERSION_FILE"
echo "" >> "$VERSION_FILE"
fi
Expand Down

0 comments on commit 4282eaa

Please sign in to comment.