From 0f0b731910ad7486ad0ffe2f4d451ed873b9c9a9 Mon Sep 17 00:00:00 2001 From: Kas-tle <26531652+Kas-tle@users.noreply.github.com> Date: Sun, 28 Apr 2024 07:29:23 -0700 Subject: [PATCH] Don't use tee to write metadata.json to downloads API --- .github/workflows/build.yml | 7 ++++--- .github/workflows/preview.yml | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 284fa265a84..7ec013dc2f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,14 +136,15 @@ jobs: run: | cat metadata.json echo + mv metadata.json metadata.json.tmp version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2) - cat metadata.json | jq --arg project "${PROJECT}" --arg version "${version}" ' + jq --arg project "${PROJECT}" --arg version "${version}" ' . | .changes |= map({"commit", "summary", "message"}) | .downloads |= map_values({"name", "sha256"}) | {$project, "repo", $version, "number": .build, "changes", "downloads"} - ' | tee metadata.json - echo + ' metadata.json.tmp > metadata.json + cat metadata.json - name: Publish to Downloads API if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }} shell: bash diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 13712d5ef6a..1268f06743a 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -69,11 +69,13 @@ jobs: run: | cat metadata.json echo - cat metadata.json | jq --arg project "${PROJECT}" --arg version "${VERSION}" --arg number "${BUILD}" ' + mv metadata.json metadata.json.tmp + jq --arg project "${PROJECT}" --arg version "${VERSION}" --arg number "${BUILD}" ' . | .downloads |= map_values({"name", "sha256"}) | {$project, "repo", $version, "number": $number | tonumber, "changes": [], "downloads"} - ' | tee metadata.json + ' metadata.json.tmp > metadata.json + cat metadata.json - name: Publish to Downloads API if: success() shell: bash