Исправлено получение ID релиза: ANSI-цвета node при FORCE_COLOR
Some checks failed
Release / release (push) Failing after 7m47s
Some checks failed
Release / release (push) Failing after 7m47s
console.log(число) в образе electronuserland/builder выводил \e[33m37\e[39m, из-за чего URL загрузки файлов был битым. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
34d6dc0aaf
commit
1518016568
1 changed files with 4 additions and 3 deletions
|
|
@ -108,7 +108,7 @@ jobs:
|
|||
-d "${PAYLOAD}" \
|
||||
"https://git.vodyanoysh.ru/api/v1/repos/vodyanoy/aero-mail/releases")
|
||||
|
||||
RELEASE_ID=$(printf '%s' "$RELEASE" | node -e 'let input = ""; process.stdin.on("data", chunk => { input += chunk }); process.stdin.on("end", () => { const release = JSON.parse(input); if (!Number.isSafeInteger(release.id)) throw new Error("Некорректный ID релиза"); console.log(release.id) })')
|
||||
RELEASE_ID=$(printf '%s' "$RELEASE" | node -e 'let input = ""; process.stdin.on("data", chunk => { input += chunk }); process.stdin.on("end", () => { const release = JSON.parse(input); if (!Number.isSafeInteger(release.id)) throw new Error("Некорректный ID релиза"); process.stdout.write(String(release.id)) })')
|
||||
printf '%s' "${RELEASE_ID}" > /tmp/release-id.txt
|
||||
|
||||
- name: Upload Linux and Windows release files
|
||||
|
|
@ -116,8 +116,9 @@ jobs:
|
|||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
run: |
|
||||
RELEASE_ID=$(tr -cd '0-9' < /tmp/release-id.txt)
|
||||
test -n "${RELEASE_ID}"
|
||||
RELEASE_ID=$(cat /tmp/release-id.txt)
|
||||
# Только цифры: защита от ANSI-цветов (FORCE_COLOR) и прочего мусора
|
||||
printf '%s' "${RELEASE_ID}" | grep -qxE '[0-9]+' || { echo "Некорректный ID релиза: $(printf '%s' "${RELEASE_ID}" | od -c)"; exit 1; }
|
||||
for ASSET_PATH in "dist/aero-mail-${VERSION}.AppImage" "dist/aero-mail-${VERSION}-win-x64.exe" "dist/aero-mail-${VERSION}-win-x64.exe.blockmap" dist/latest.yml; do
|
||||
ASSET_NAME=$(basename "${ASSET_PATH}")
|
||||
URL="https://git.vodyanoysh.ru/api/v1/repos/vodyanoy/aero-mail/releases/${RELEASE_ID}/assets?name=${ASSET_NAME}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue