Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/__call-update-flathub-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,40 +136,6 @@ jobs:
"https://raw.githubusercontent.com/LizardByte/.github/master/.github/ISSUE_TEMPLATE/config.yml" \
".github/ISSUE_TEMPLATE/config.yml"

- name: Update metainfo.xml
id: update_metainfo
if: >-
steps.check-label.outputs.hasTopic == 'true' &&
steps.check-release.outputs.isLatestRelease == 'true'
env:
CHANGELOG: ${{ github.event.release.body }}
run: |
# Set the metainfo file and placeholder generated by the release asset.
xml_file="flathub/${{ env.FLATHUB_PKG }}/${{ env.FLATHUB_PKG }}.metainfo.xml"
placeholder="<!-- changelog -->"

# Treat replacement text literally during Bash parameter substitutions.
shopt -u patsub_replacement 2>/dev/null || true

# Escape XML-sensitive characters from the release body.
changelog="${CHANGELOG:-}"
changelog="${changelog//&/&amp;}"
changelog="${changelog//</&lt;}"
changelog="${changelog//>/&gt;}"

# Read the full metainfo file, preserving newlines.
IFS= read -r -d '' contents < "$xml_file" || true

# Fail clearly if the generated metainfo file no longer has the expected marker.
if [[ "$contents" != *"$placeholder"* ]]; then
echo "$placeholder not found in $xml_file"
exit 1
fi

# Replace the placeholder with the escaped changelog and write the file back.
contents="${contents//$placeholder/$changelog}"
printf '%s' "$contents" > "$xml_file"

- name: Update submodule
if: >-
steps.check-label.outputs.hasTopic == 'true' &&
Expand Down