Skip to content

Commit de57a87

Browse files
committed
fix: only consider releases that start with v, exclude miner
1 parent 34e7fcf commit de57a87

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

.github/workflows/update-versions.yml

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

33
on:
4-
schedule:
5-
- cron: '0 0 * * 1' # Runs at 00:00 every Monday
64
workflow_dispatch: # Allows manual trigger
75
pull_request:
86
types: [opened, reopened, synchronize]
@@ -21,20 +19,15 @@ jobs:
2119
- name: Get latest Lotus version
2220
id: get-version
2321
run: |
24-
# Get the latest release info
25-
RELEASE_INFO=$(curl -s https://api.github.com/repos/filecoin-project/lotus/releases/latest)
22+
# 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')
2625
2726
# Extract the tag name
2827
TAG_NAME=$(echo "$RELEASE_INFO" | jq -r .tag_name)
2928
30-
# Handle different tag formats
31-
if [[ $TAG_NAME == *"miner"* ]]; then
32-
# For miner tags, extract everything after 'v'
33-
LATEST_VERSION=$(echo $TAG_NAME | sed -E 's/.*v([^/]*).*/\1/')
34-
else
35-
# For standard tags (e.g., v1.31.1)
36-
LATEST_VERSION=$(echo $TAG_NAME | sed 's/^v//')
37-
fi
29+
# Extract version number (remove 'v' prefix)
30+
LATEST_VERSION=$(echo $TAG_NAME | sed 's/^v//')
3831
3932
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
4033
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
@@ -46,20 +39,11 @@ jobs:
4639
- name: Create Pull Request
4740
uses: peter-evans/create-pull-request@v5
4841
with:
49-
commit-message: 'chore: update Lotus version references to ${{ env.LATEST_VERSION }}'
50-
title: 'chore: update Lotus version references to ${{ env.LATEST_VERSION }}'
42+
commit-message: 'Chore: update Lotus version references to ${{ env.LATEST_VERSION }}'
43+
title: 'Chore: update Lotus version references to ${{ env.LATEST_VERSION }}'
5144
body: |
5245
Automated PR to update Lotus version references to ${{ env.LATEST_VERSION }}
5346
54-
Original tag: ${{ env.TAG_NAME }}
55-
Extracted version: ${{ env.LATEST_VERSION }}
56-
57-
This PR updates all references of:
58-
- `lotus-X.X.X`
59-
- Previous lotus version numbers
60-
61-
to `lotus-${{ env.LATEST_VERSION }}`
62-
6347
This PR was automatically generated by GitHub Actions.
6448
branch: update-lotus-version
6549
base: main

0 commit comments

Comments
 (0)