Skip to content

Commit 338bc54

Browse files
committed
fix latest release detection: created_at was not reliable
1 parent 81c40ef commit 338bc54

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/stable.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ jobs:
2424
UPSTREAM_RELEASE=$(gh api repos/zed-industries/zed/releases/latest --jq '{tag_name, body}')
2525
UPSTREAM_TAG=$(echo "$UPSTREAM_RELEASE" | jq -r '.tag_name')
2626
echo "Latest upstream release: $UPSTREAM_TAG"
27-
27+
2828
# Get latest stable release tag from current repo
29-
CURRENT_TAG=$(gh api repos/${{ github.repository }}/releases --jq '[.[] | select(.prerelease == false)] | sort_by(.created_at) | reverse | .[0].tag_name // "none"')
29+
CURRENT_TAG=$(gh api repos/${{ github.repository }}/releases/latest --jq '.tag_name // "none"')
3030
echo "Latest current repo release: $CURRENT_TAG"
31-
31+
3232
# Set variables based on comparison
3333
if [ "$UPSTREAM_TAG" != "$CURRENT_TAG" ]; then
3434
echo "Building stable release from upstream tag: $UPSTREAM_TAG"
3535
echo "build_ref=$UPSTREAM_TAG" >> $GITHUB_OUTPUT
3636
echo "release_tag=$UPSTREAM_TAG" >> $GITHUB_OUTPUT
3737
echo "should_build=true" >> $GITHUB_OUTPUT
38-
38+
3939
# Copy over the release body from the repository
4040
RELEASE_BODY=$(echo "$UPSTREAM_RELEASE" | jq -r '.body')
4141
# Use delimiter syntax for multiline outputs

0 commit comments

Comments
 (0)