Skip to content

Commit 88bb005

Browse files
authored
Replace gh release download with go install in smoke workflow (#63)
Replace `gh release download` for obtaining the Dependabot CLI with `go install github.com/dependabot/cli/cmd/dependabot@latest`. This is simpler, doesn't require gh authentication or tar extraction, and aligns with dependabot/smoke-tests#404. Also simplifies the smoke test download to a single gh api call using the raw content Accept header.
1 parent 3710637 commit 88bb005

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/smoke.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,17 @@ jobs:
3535
with:
3636
persist-credentials: false
3737

38-
- name: Download CLI and test
38+
- name: Add Go bin to PATH
39+
run: echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
40+
41+
- name: Install Dependabot CLI
42+
run: go install github.com/dependabot/cli/cmd/dependabot@latest
43+
44+
- name: Download smoke test
3945
env:
4046
SUITE: ${{ matrix.suite }}
4147
run: |
42-
gh release download --repo dependabot/cli -p "*linux-amd64.tar.gz"
43-
tar xzvf *.tar.gz >/dev/null 2>&1
44-
./dependabot --version
45-
URL="https://api.github.com/repos/dependabot/smoke-tests/contents/tests/smoke-${SUITE}.yaml"
46-
curl $(gh api "$URL" --jq .download_url) -o smoke.yaml
48+
gh api "repos/dependabot/smoke-tests/contents/tests/smoke-${SUITE}.yaml" -H "Accept: application/vnd.github.raw" > smoke.yaml
4749
4850
# Download the Proxy cache. The job is ideally 100% cached so no real calls are made.
4951
- name: Download cache
@@ -60,7 +62,7 @@ jobs:
6062
LOCAL_GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6163
run: |
6264
set -o pipefail
63-
./dependabot test \
65+
dependabot test \
6466
-f=smoke.yaml \
6567
-o=result.yaml \
6668
--cache=cache \

0 commit comments

Comments
 (0)