Skip to content

Commit bb66d4a

Browse files
committed
fix(github): tolerate rate-limited version lookup in the action
Composite bash steps run with -e -o pipefail, so a failed unauthenticated curl to api.github.com (shared runner IPs regularly exhaust the 60/hr limit) kills the step before the ${VERSION:-latest} fallback on the next line can apply. Authenticate the lookup with github.token and let the pipeline fail soft so the documented fallback is actually reachable.
1 parent 518b0bf commit bb66d4a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

github/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ runs:
4444
- name: Get opencode version
4545
id: version
4646
shell: bash
47+
env:
48+
GH_TOKEN: ${{ github.token }}
4749
run: |
48-
VERSION=$(curl -sf https://api.github.com/repos/anomalyco/opencode/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4)
50+
VERSION=$(curl -sf -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/repos/anomalyco/opencode/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4 || true)
4951
echo "version=${VERSION:-latest}" >> $GITHUB_OUTPUT
5052
5153
- name: Cache opencode

0 commit comments

Comments
 (0)