Skip to content

Commit 4c300e1

Browse files
committed
fix: use temp files for jq parsing to handle large release JSON with app-prefixed tag filtering
1 parent 3c57efe commit 4c300e1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/web-deploy-ipfs.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ jobs:
3737
attempt=1
3838
while true; do
3939
echo "Attempt $attempt to fetch release info..."
40-
RELEASES=$(curl -sSf "$API_URL")
41-
if [ $? -eq 0 ] && echo "$RELEASES" | jq -e '. | length > 0' > /dev/null; then
40+
curl -sSf "$API_URL" > /tmp/releases.json
41+
if [ $? -eq 0 ] && jq -e '. | length > 0' /tmp/releases.json > /dev/null; then
4242
# Filter for the latest non-draft, non-prerelease wallet release (tag starts with "v")
43-
RELEASE_INFO=$(echo "$RELEASES" | jq '[.[] | select(.draft == false and .prerelease == false and (.tag_name | startswith("v")))][0]')
44-
43+
jq '[.[] | select(.draft == false and .prerelease == false and (.tag_name | startswith("v")))][0]' /tmp/releases.json > /tmp/release_info.json
44+
4545
# Check if we found a valid release
46-
if [ "$RELEASE_INFO" != "null" ] && echo "$RELEASE_INFO" | jq -e '.assets' > /dev/null; then
46+
if [ "$(cat /tmp/release_info.json)" != "null" ] && jq -e '.assets' /tmp/release_info.json > /dev/null; then
4747
break
4848
fi
49-
49+
5050
echo "No stable release found, retrying..."
5151
fi
5252
@@ -60,9 +60,9 @@ jobs:
6060
done
6161
6262
## Extract the tag name, tar URL, and checksum URL from the release info
63-
TAG_NAME=$(echo "$RELEASE_INFO" | jq -r '.tag_name')
64-
TAR_URL=$(echo "$RELEASE_INFO" | jq -r '.assets[] | select(.name | endswith(".tar.gz")) | .browser_download_url')
65-
CHECKSUM_URL=$(echo "$RELEASE_INFO" | jq -r '.assets[] | select(.name | endswith("-sha256-checksum.txt")) | .browser_download_url')
63+
TAG_NAME=$(jq -r '.tag_name' /tmp/release_info.json)
64+
TAR_URL=$(jq -r '.assets[] | select(.name | endswith(".tar.gz")) | .browser_download_url' /tmp/release_info.json)
65+
CHECKSUM_URL=$(jq -r '.assets[] | select(.name | endswith("-sha256-checksum.txt")) | .browser_download_url' /tmp/release_info.json)
6666
6767
## Store the tag name, tar URL, and checksum URL in the GitHub output
6868
echo "latest_tag=$TAG_NAME" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)