Skip to content

Commit 5a71d96

Browse files
committed
CI: update CI to better format custom update messages
1 parent 09daaae commit 5a71d96

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
type: boolean
1313
default: false
1414
custom_notes:
15-
description: 'Custom updates to append to release notes'
15+
description: 'Custom updates to add to What''s Changed section'
1616
required: false
1717
type: string
1818
workflow_call:
@@ -70,21 +70,29 @@ jobs:
7070
- name: Prepare release notes
7171
id: release-notes
7272
run: |
73-
NOTES="${{ steps.get-commits.outputs.commits }}"
74-
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ github.event.inputs.custom_notes }}" != "" ]; then
75-
NOTES="${NOTES}
73+
# Create a temporary file for release notes
74+
NOTES_FILE=$(mktemp)
75+
76+
# Process custom notes if they exist
77+
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ github.event.inputs.custom_notes }}" ]; then
78+
CUSTOM_NOTES="${{ github.event.inputs.custom_notes }}"
7679
77-
## Custom Updates
78-
${{ github.event.inputs.custom_notes }}"
80+
# Check if custom notes already have bullet points or GitHub-style formatting
81+
if echo "$CUSTOM_NOTES" | grep -q "^\*\|^- \|http.*commit\|in #[0-9]\+"; then
82+
# Already formatted, use as is
83+
echo "$CUSTOM_NOTES" > "$NOTES_FILE"
84+
else
85+
# Add bullet point formatting
86+
echo "- $CUSTOM_NOTES" > "$NOTES_FILE"
87+
fi
7988
fi
80-
echo "notes<<EOF" >> $GITHUB_OUTPUT
81-
echo "$NOTES" >> $GITHUB_OUTPUT
82-
echo "EOF" >> $GITHUB_OUTPUT
89+
90+
echo "notes_file=$NOTES_FILE" >> $GITHUB_OUTPUT
8391
- name: Zip root-module directory
8492
run: sh ./build-magisk-module.sh
8593
- name: Delete release if exist then create release
8694
env:
8795
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8896
run: |
8997
gh release view "nightly" && gh release delete "nightly" -y --cleanup-tag
90-
gh release create "nightly" "./$APK_NAME" "./btl2capfix.zip" -p -t "Nightly Release" -n "${{ steps.release-notes.outputs.notes }}" --generate-notes
98+
gh release create "nightly" "./$APK_NAME" "./btl2capfix.zip" -p -t "Nightly Release" --notes-file "${{ steps.release-notes.outputs.notes_file }}" --generate-notes

0 commit comments

Comments
 (0)