@@ -76,36 +76,60 @@ Installed: 2025-10-03T12:00:00Z
76
76
77
77
## Step 3: Fetch Latest Stable Release
78
78
79
- ### Call GitHub API for latest release
79
+ ### Call GitHub API for latest release (with timeout)
80
80
``` bash
81
- bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2> /dev/null)
81
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2> /dev/null, timeout: 30000 )
82
82
```
83
83
84
84
### Extract tag name (version)
85
85
``` bash
86
- bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2> /dev/null | grep -o ' "tag_name": *"[^"]*"' | head -1 | cut -d' "' -f4)
86
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2> /dev/null | grep -o ' "tag_name": *"[^"]*"' | head -1 | cut -d' "' -f4, timeout: 30000)
87
+ ```
88
+
89
+ ### Extract release name
90
+ ``` bash
91
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2> /dev/null | grep -o ' "name": *"[^"]*"' | head -1 | cut -d' "' -f4, timeout: 30000)
92
+ ```
93
+
94
+ ### Extract published date
95
+ ``` bash
96
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2> /dev/null | grep -o ' "published_at": *"[^"]*"' | cut -d' "' -f4, timeout: 30000)
87
97
```
88
98
89
99
** Output Format** :
90
100
```
91
101
Latest Stable: v3.2.2
102
+ Release: v3.2.2: Independent Test-Gen Workflow with Cross-Session Context
103
+ Published: 2025-10-03T04:10:08Z
92
104
```
93
105
94
106
## Step 4: Fetch Latest Main Branch
95
107
96
- ### Call GitHub API for main branch
108
+ ### Call GitHub API for latest commit on main (with timeout)
97
109
``` bash
98
- bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/branches /main" 2> /dev/null)
110
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits /main" 2> /dev/null, timeout: 30000 )
99
111
```
100
112
101
113
### Extract commit SHA (short)
102
114
``` bash
103
- bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/branches/main" 2> /dev/null | grep -o ' "sha": *"[^"]*"' | head -1 | cut -d' "' -f4 | cut -c1-7)
115
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2> /dev/null | grep -o ' "sha": *"[^"]*"' | head -1 | cut -d' "' -f4 | cut -c1-7, timeout: 30000)
116
+ ```
117
+
118
+ ### Extract commit message (first line only)
119
+ ``` bash
120
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2> /dev/null | grep ' "message":' | cut -d' "' -f4 | cut -d' \' -f1, timeout: 30000)
121
+ ```
122
+
123
+ ### Extract commit date
124
+ ``` bash
125
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2> /dev/null | grep -o ' "date": *"[^"]*"' | head -1 | cut -d' "' -f4, timeout: 30000)
104
126
```
105
127
106
128
** Output Format** :
107
129
```
108
- Latest Dev: a1b2c3d
130
+ Latest Dev: a03415b
131
+ Message: feat: Add version tracking and upgrade check system
132
+ Date: 2025-10-03T04:46:44Z
109
133
```
110
134
111
135
## Step 5: Compare Versions and Suggest Upgrade
@@ -166,11 +190,23 @@ bash(cat version.json | grep -o '"version": *"[^"]*"' | cut -d'"' -f4)
166
190
# Extract date from JSON
167
191
bash(cat version.json | grep -o ' "installation_date_utc": *"[^"]*"' | cut -d' "' -f4)
168
192
169
- # Fetch latest release
170
- bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" )
193
+ # Fetch latest release (with timeout)
194
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2> /dev/null, timeout: 30000 )
171
195
172
196
# Extract tag name
173
- bash(curl -s https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest | grep -o ' "tag_name": *"[^"]*"' | cut -d' "' -f4)
197
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2> /dev/null | grep -o ' "tag_name": *"[^"]*"' | cut -d' "' -f4, timeout: 30000)
198
+
199
+ # Extract release name
200
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest" 2> /dev/null | grep -o ' "name": *"[^"]*"' | head -1 | cut -d' "' -f4, timeout: 30000)
201
+
202
+ # Fetch latest commit (with timeout)
203
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2> /dev/null, timeout: 30000)
204
+
205
+ # Extract commit SHA
206
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2> /dev/null | grep -o ' "sha": *"[^"]*"' | head -1 | cut -d' "' -f4 | cut -c1-7, timeout: 30000)
207
+
208
+ # Extract commit message (first line)
209
+ bash(curl -fsSL " https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main" 2> /dev/null | grep ' "message":' | cut -d' "' -f4 | cut -d' \' -f1, timeout: 30000)
174
210
175
211
# Compare versions
176
212
bash(printf " %s\n%s" " 3.2.1" " 3.2.2" | sort -V | tail -n 1)
@@ -204,8 +240,21 @@ ERROR: version.json is invalid or corrupted
204
240
- Uses simple, direct bash commands instead of complex functions
205
241
- Each step is independent and can be executed separately
206
242
- Fallback to grep/sed for JSON parsing (no jq dependency required)
207
- - Network calls use curl with error suppression
243
+ - Network calls use curl with error suppression and 30-second timeout
208
244
- Version comparison uses ` sort -V ` for accurate semantic versioning
245
+ - Use ` /commits/main ` API instead of ` /branches/main ` for more reliable commit info
246
+ - Extract first line of commit message using ` cut -d'\' -f1 ` to handle JSON escape sequences
247
+
248
+ ## API Endpoints
249
+
250
+ ### GitHub API Used
251
+ - ** Latest Release** : ` https://api.github.com/repos/catlog22/Claude-Code-Workflow/releases/latest `
252
+ - Fields: ` tag_name ` , ` name ` , ` published_at `
253
+ - ** Latest Commit** : ` https://api.github.com/repos/catlog22/Claude-Code-Workflow/commits/main `
254
+ - Fields: ` sha ` , ` commit.message ` , ` commit.author.date `
255
+
256
+ ### Timeout Configuration
257
+ All network calls should use ` timeout: 30000 ` (30 seconds) to handle slow connections.
209
258
210
259
## Related Commands
211
260
- ` /cli:cli-init ` - Initialize CLI configurations
0 commit comments