diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 303dcecc3..02ed5f959 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -205,13 +205,17 @@ jobs: - name: Write Changelog to Plugin XML run: | - notes=$(cat <(.*)<\/CHANGES>/\n${escapedNotes}\n<\/CHANGES>/g" "dynamix.unraid.net.staging.plg" + # Capture the pull request number and latest commit message + pr_number="${{ github.event.pull_request.number }}" + commit_message=$(git log -1 --pretty=%B) + + # Clean up newlines, escape special characters, and handle line breaks + notes=$(echo -e "Pull Request Build: ${pr_number}\n${commit_message}" | \ + sed ':a;N;$!ba;s/\n/\\n/g' | \ + sed -e 's/[&\\/]/\\&/g') + + # Replace tag content in the file + sed -i -z -E "s/(.*)<\/CHANGES>/\n${notes}\n<\/CHANGES>/g" "dynamix.unraid.net.staging.plg" - name: Copy other release files to pr-release run: |