Skip to content

Commit d2c7c50

Browse files
sicoyleCopilot
andauthored
fix(build): handle rate limiting causing failures in build (#958)
* fix(build): handle rate limiting causing failures in build Signed-off-by: Samantha Coyle <sam@diagrid.io> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Sam <sam@diagrid.io> * fix: address copilot feedback Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix:update for build to curl properly Signed-off-by: Samantha Coyle <sam@diagrid.io> --------- Signed-off-by: Samantha Coyle <sam@diagrid.io> Signed-off-by: Sam <sam@diagrid.io> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 49da5ec commit d2c7c50

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/validate_examples.yaml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,27 @@ jobs:
6666
ref: ${{ env.CHECKOUT_REF }}
6767
- uses: azure/setup-helm@v4
6868
- name: Determine latest Dapr Runtime version (including prerelease)
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6971
run: |
70-
RUNTIME_VERSION=$(curl -s "https://api.github.com/repos/dapr/dapr/releases" | sort -r | grep '"tag_name"' | head -n 1 | cut -d ':' -f2 | tr -d '",v ')
72+
RUNTIME_VERSION=$(curl -fsS -H "Authorization: Bearer $GITHUB_TOKEN" \
73+
"https://api.github.com/repos/dapr/dapr/releases?per_page=10" | \
74+
jq -r 'sort_by(.created_at) | reverse | .[0].tag_name | ltrimstr("v")')
75+
if [ -z "$RUNTIME_VERSION" ] || [ "$RUNTIME_VERSION" = "null" ]; then
76+
echo "Failed to resolve Dapr Runtime version" && exit 1
77+
fi
7178
echo "DAPR_RUNTIME_VER=$RUNTIME_VERSION" >> $GITHUB_ENV
7279
echo "Found $RUNTIME_VERSION"
73-
- name: Determine latest Dapr Cli version (including prerelease)
80+
- name: Determine latest Dapr CLI version (including prerelease)
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7483
run: |
75-
CLI_VERSION=$(curl -s "https://api.github.com/repos/dapr/cli/releases" | sort -r | grep '"tag_name"' | head -n 1 | cut -d ':' -f2 | tr -d '",v ')
84+
CLI_VERSION=$(curl -fsS -H "Authorization: Bearer $GITHUB_TOKEN" \
85+
"https://api.github.com/repos/dapr/cli/releases?per_page=10" | \
86+
jq -r 'sort_by(.created_at) | reverse | .[0].tag_name | ltrimstr("v")')
87+
if [ -z "$CLI_VERSION" ] || [ "$CLI_VERSION" = "null" ]; then
88+
echo "Failed to resolve Dapr CLI version" && exit 1
89+
fi
7690
echo "DAPR_CLI_VER=$CLI_VERSION" >> $GITHUB_ENV
7791
echo "Found $CLI_VERSION"
7892
- name: Set up Python ${{ matrix.python_ver }}
@@ -84,7 +98,10 @@ jobs:
8498
python -m pip install --upgrade pip
8599
pip install setuptools wheel twine tox
86100
- name: Set up Dapr CLI
87-
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
101+
run: |
102+
wget -q "https://github.com/dapr/cli/releases/download/v${{ env.DAPR_CLI_VER }}/dapr_${{ env.GOOS }}_${{ env.GOARCH }}.tar.gz" -O /tmp/dapr.tar.gz
103+
sudo tar xzf /tmp/dapr.tar.gz -C /usr/local/bin dapr
104+
dapr --version
88105
- name: Set up Go ${{ env.GOVER }}
89106
if: env.DAPR_REF != '' || env.DAPR_CLI_REF != ''
90107
uses: actions/setup-go@v5

0 commit comments

Comments
 (0)