Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: check if release notes are properly created #1122

Merged
merged 5 commits into from
Jul 4, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/make_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ jobs:
RELEASE_NOTES="${RELEASE_NOTES//'%'/'%25'}"
RELEASE_NOTES="${RELEASE_NOTES//$'\n'/'%0A'}"
RELEASE_NOTES="${RELEASE_NOTES//$'\r'/'%0D'}"
echo ------------------
echo "${RELEASE_NOTES}"
echo "name=contents=${RELEASE_NOTES}" >> "$GITHUB_ENV"

- name: check if prerelease
Expand All @@ -111,6 +113,9 @@ jobs:

shell: bash

- name: check release notes
run: echo ${{ steps.release_notes.outputs.contents }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider validating the release notes content.

While echoing the release notes is useful, adding a validation check to ensure the content meets certain criteria (e.g., non-empty, follows a specific format) would be beneficial.

-  run: echo ${{ steps.release_notes.outputs.contents }}
+  run: |
+    RELEASE_NOTES=${{ steps.release_notes.outputs.contents }}
+    if [ -z "$RELEASE_NOTES" ]; then
+      echo "Release notes are empty. Aborting release."
+      exit 1
+    fi
+    echo "$RELEASE_NOTES"
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: check release notes
run: echo ${{ steps.release_notes.outputs.contents }}
- name: check release notes
run: |
RELEASE_NOTES=${{ steps.release_notes.outputs.contents }}
if [ -z "$RELEASE_NOTES" ]; then
echo "Release notes are empty. Aborting release."
exit 1
fi
echo "$RELEASE_NOTES"


- name: Create Release
uses: "softprops/action-gh-release@v2"
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
Expand Down
Loading