@@ -136,40 +136,6 @@ jobs:
136136 "https://raw.githubusercontent.com/LizardByte/.github/master/.github/ISSUE_TEMPLATE/config.yml" \
137137 ".github/ISSUE_TEMPLATE/config.yml"
138138
139- - name : Update metainfo.xml
140- id : update_metainfo
141- if : >-
142- steps.check-label.outputs.hasTopic == 'true' &&
143- steps.check-release.outputs.isLatestRelease == 'true'
144- env :
145- CHANGELOG : ${{ github.event.release.body }}
146- run : |
147- # Set the metainfo file and placeholder generated by the release asset.
148- xml_file="flathub/${{ env.FLATHUB_PKG }}/${{ env.FLATHUB_PKG }}.metainfo.xml"
149- placeholder="<!-- changelog -->"
150-
151- # Treat replacement text literally during Bash parameter substitutions.
152- shopt -u patsub_replacement 2>/dev/null || true
153-
154- # Escape XML-sensitive characters from the release body.
155- changelog="${CHANGELOG:-}"
156- changelog="${changelog//&/&}"
157- changelog="${changelog//</<}"
158- changelog="${changelog//>/>}"
159-
160- # Read the full metainfo file, preserving newlines.
161- IFS= read -r -d '' contents < "$xml_file" || true
162-
163- # Fail clearly if the generated metainfo file no longer has the expected marker.
164- if [[ "$contents" != *"$placeholder"* ]]; then
165- echo "$placeholder not found in $xml_file"
166- exit 1
167- fi
168-
169- # Replace the placeholder with the escaped changelog and write the file back.
170- contents="${contents//$placeholder/$changelog}"
171- printf '%s' "$contents" > "$xml_file"
172-
173139 - name : Update submodule
174140 if : >-
175141 steps.check-label.outputs.hasTopic == 'true' &&
0 commit comments