1
1
name : Update Lotus Version
2
2
3
3
on :
4
- schedule :
5
- - cron : ' 0 0 * * 1' # Runs at 00:00 every Monday
6
4
workflow_dispatch : # Allows manual trigger
7
5
pull_request :
8
6
types : [opened, reopened, synchronize]
@@ -21,20 +19,15 @@ jobs:
21
19
- name : Get latest Lotus version
22
20
id : get-version
23
21
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')
26
25
27
26
# Extract the tag name
28
27
TAG_NAME=$(echo "$RELEASE_INFO" | jq -r .tag_name)
29
28
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//')
38
31
39
32
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
40
33
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
@@ -46,20 +39,11 @@ jobs:
46
39
- name : Create Pull Request
47
40
uses : peter-evans/create-pull-request@v5
48
41
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 }}'
51
44
body : |
52
45
Automated PR to update Lotus version references to ${{ env.LATEST_VERSION }}
53
46
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
-
63
47
This PR was automatically generated by GitHub Actions.
64
48
branch : update-lotus-version
65
49
base : main
0 commit comments