diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 2600460d..b1e931a7 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -160,32 +160,57 @@ jobs: - name: Generate release body text id: generate-body run: | + # Enable debugging + set -x + + # Initialize the release body RELEASE_BODY="# Release Notes\n" - RELEASE_BODY+="This release is based on the commit: ${{ github.repository }}@${{ github.sha }}.\n" - RELEASE_BODY+="On branch [${{ env.BRANCH_NAME }}](https://github.com/RetroDECK/RetroDECK/tree/${{ env.BRANCH_NAME }}).\n\n" + RELEASE_BODY+="This release is based on the commit: RetroDECK/RetroDECK@c8bd579ad4d0922ba7ab1f5c122cc782ff6adc66.\n" + RELEASE_BODY+="On branch [cooker](https://github.com/RetroDECK/RetroDECK/tree/cooker).\n\n" RELEASE_BODY+="## Commits since last release\n" - RELEASE_BODY+="${{ steps.get-commits.outputs.commits }}\n\n" + RELEASE_BODY+="- RELEASE NOTES: fixed body\n\n" # Define the XML file path xml_file="./net.retrodeck.retrodeck.appdata.xml" - # Extract the raw description content - raw_description=$(xmlstarlet sel -t -m "/component/releases/release[1]/description/*" -c "." -n "$xml_file") + # Check if the XML file exists + if [[ ! -f "$xml_file" ]]; then + echo "Error: XML file not found: $xml_file" + exit 1 + fi - # Convert
tags to markdown headers using sed and place headers correctly + # Extract the raw description content + raw_description=$(xmlstarlet sel -t -m "/component/releases/release[1]/description/*" -c "." -n "$xml_file" 2>/dev/null) + + # Check if xmlstarlet extraction was successful + if [[ $? -ne 0 ]]; then + echo "Error: Failed to extract description content using xmlstarlet" + exit 1 + fi + + # Convert
tags to markdown headers using sed markdown_description=$(echo "$raw_description" | sed -e 's|
|\n### |g' -e 's|
||g') - # Convert