Skip to content

Commit 702ace0

Browse files
author
durable-execution-dev
committed
ci: use curl for milestone badge (gh absent on runner)
1 parent 681b12c commit 702ace0

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,15 @@ jobs:
110110
run: |
111111
set -euo pipefail
112112
113-
TITLE=$(gh api repos/${{ github.repository }}/milestones \
114-
--jq '[.[] | select(.state == "open" and .due_on != null)] | sort_by(.due_on) | .[0].title // empty')
113+
# Use curl + jq rather than the GitHub CLI: gh is not preinstalled on
114+
# the CodeBuild runner image. GITHUB_API_URL/GH_TOKEN are provided by
115+
# Actions; the jq filter matches the previous `gh api --jq` behavior.
116+
TITLE=$(curl -sfL \
117+
-H "Authorization: Bearer ${GH_TOKEN}" \
118+
-H "Accept: application/vnd.github+json" \
119+
-H "X-GitHub-Api-Version: 2022-11-28" \
120+
"${GITHUB_API_URL}/repos/${{ github.repository }}/milestones?state=open&per_page=100" \
121+
| jq -r '[.[] | select(.state == "open" and .due_on != null)] | sort_by(.due_on) | .[0].title // empty')
115122
116123
if [ -z "$TITLE" ]; then
117124
URL="https://img.shields.io/badge/Next%20Milestone-No%20milestone-lightgrey"

0 commit comments

Comments
 (0)