|
12 | 12 | type: boolean |
13 | 13 | default: false |
14 | 14 | custom_notes: |
15 | | - description: 'Custom updates to append to release notes' |
| 15 | + description: 'Custom updates to add to What''s Changed section' |
16 | 16 | required: false |
17 | 17 | type: string |
18 | 18 | workflow_call: |
@@ -70,21 +70,29 @@ jobs: |
70 | 70 | - name: Prepare release notes |
71 | 71 | id: release-notes |
72 | 72 | 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 }}" |
76 | 79 | |
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 |
79 | 88 | 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 |
83 | 91 | - name: Zip root-module directory |
84 | 92 | run: sh ./build-magisk-module.sh |
85 | 93 | - name: Delete release if exist then create release |
86 | 94 | env: |
87 | 95 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
88 | 96 | run: | |
89 | 97 | 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