Escape changelog for YAML
With 1.17 releasing soon, we'll get to see if this was the issue very shortly. Worst case scenario the yaml is still messed up, but since the changelog is now the last element, unless it's so badly malformed that the entire action can't run the file should still upload even if the changelog does not.
This commit is contained in:
13
.github/workflows/release.yml
vendored
13
.github/workflows/release.yml
vendored
@@ -13,9 +13,6 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set CurseForge Variables
|
||||
run: . scripts/set_curseforge_env.sh
|
||||
|
||||
- name: Fetch Github Release Asset
|
||||
uses: dsaltares/fetch-gh-release-asset@0.0.5
|
||||
with:
|
||||
@@ -23,6 +20,9 @@ jobs:
|
||||
version: ${{ github.event.release.id }}
|
||||
file: OpenInv.jar
|
||||
|
||||
- name: Set CurseForge Variables
|
||||
run: . scripts/set_curseforge_env.sh "${{ github.event.release.body }}"
|
||||
|
||||
- name: Create CurseForge Release
|
||||
uses: itsmeow/curseforge-upload@v3
|
||||
with:
|
||||
@@ -30,7 +30,8 @@ jobs:
|
||||
project_id: 31432
|
||||
game_endpoint: minecraft
|
||||
file_path: ./OpenInv.jar
|
||||
changelog: ${{ github.event.release.body }}
|
||||
display_name: ${{ github.event.release.name }}
|
||||
game_versions: ${{ env.CURSEFORGE_MINECRAFT_VERSIONS }}
|
||||
display_name: "${{ github.event.release.name }}"
|
||||
game_versions: "${{ env.CURSEFORGE_MINECRAFT_VERSIONS }}"
|
||||
release_type: release
|
||||
changelog_type: markdown
|
||||
changelog: "${{ env.CURSEFORGE_CHANGELOG }}"
|
||||
|
@@ -38,5 +38,18 @@ function get_curseforge_minecraft_versions() {
|
||||
echo "${minecraft_versions}"
|
||||
}
|
||||
|
||||
# Modify provided changelog to not break when inserted into yaml file.
|
||||
function get_yaml_safe_changelog() {
|
||||
changelog=$1
|
||||
# Since we're using a flow scalar, newlines need to be doubled.
|
||||
echo "${changelog//
|
||||
/
|
||||
|
||||
}"
|
||||
}
|
||||
|
||||
minecraft_versions=$(get_curseforge_minecraft_versions)
|
||||
echo "CURSEFORGE_MINECRAFT_VERSIONS=$minecraft_versions" >> "$GITHUB_ENV"
|
||||
|
||||
changelog=$(get_yaml_safe_changelog "$1")
|
||||
printf "CURSEFORGE_CHANGELOG<<EOF\n%s\nEOF\n" "$changelog" >> "$GITHUB_ENV"
|
Reference in New Issue
Block a user