Skip to content

Commit fa0fe3f

Browse files
authored
Merge pull request #2377 from filecoin-project/bp/fix-github-action
FIX: fetch only the latest lotus version
2 parents 307bbc7 + f960119 commit fa0fe3f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/update-versions.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Update Lotus Version
22

33
on:
4-
workflow_dispatch: # Allows manual trigger
4+
workflow_dispatch:
55
pull_request:
66
types: [opened, reopened]
77

@@ -20,12 +20,11 @@ jobs:
2020
id: get-version
2121
run: |
2222
# Get all releases and find the first one starting with 'v'
23-
RELEASE_INFO=$(curl -s "https://api.github.com/repos/filecoin-project/lotus/releases" | \
24-
jq -r '[.[] | select(.tag_name | startswith("v"))] | first')
25-
26-
# Extract the tag name
27-
TAG_NAME=$(echo "$RELEASE_INFO" | jq -r .tag_name)
23+
RELEASE_INFO=$(curl -s "https://api.github.com/repos/filecoin-project/lotus/releases/latest")
2824
25+
# Find first tag that starts with 'v' but not 'miner'
26+
TAG_NAME=$(echo "$RELEASE_INFO" | jq -r 'select(.tag_name | startswith("v") and (contains("miner") | not)) | .tag_name')
27+
2928
# Extract version number (remove 'v' prefix)
3029
LATEST_VERSION=$(echo $TAG_NAME | sed 's/^v//')
3130

0 commit comments

Comments
 (0)