Skip to content

Commit 62b4909

Browse files
ci: authenticate GitHub API call for latest release lookup
The unauthenticated curl was being rate-limited on shared runner IPs, causing jq to parse the error response and emit "null" as the tag. Use the existing app token and fail loudly if the tag can't be resolved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 206d977 commit 62b4909

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/update-sourcebot-version.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,20 @@ jobs:
3737
3838
- name: Get latest Sourcebot release
3939
id: latest-version
40+
env:
41+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
4042
run: |
41-
LATEST_VERSION=$(curl -s https://api.github.com/repos/sourcebot-dev/sourcebot/releases/latest | jq -r '.tag_name')
43+
LATEST_VERSION=$(curl -sSf \
44+
-H "Authorization: Bearer $GH_TOKEN" \
45+
-H "Accept: application/vnd.github+json" \
46+
https://api.github.com/repos/sourcebot-dev/sourcebot/releases/latest \
47+
| jq -r '.tag_name')
48+
49+
if [ -z "$LATEST_VERSION" ] || [ "$LATEST_VERSION" = "null" ]; then
50+
echo "Failed to fetch latest release tag" >&2
51+
exit 1
52+
fi
53+
4254
echo "latest=$LATEST_VERSION" >> $GITHUB_OUTPUT
4355
echo "Latest Sourcebot version: $LATEST_VERSION"
4456

0 commit comments

Comments
 (0)