Skip to content

Replace gh release download with go install in smoke workflow#63

Merged
jeffwidman merged 1 commit intomainfrom
replace-gh-release-with-go-install
Mar 9, 2026
Merged

Replace gh release download with go install in smoke workflow#63
jeffwidman merged 1 commit intomainfrom
replace-gh-release-with-go-install

Conversation

@jeffwidman
Copy link
Copy Markdown
Member

What

Replace gh release download for obtaining the Dependabot CLI with go install github.com/dependabot/cli/cmd/dependabot@latest.

Why

Changes

  • Replaced gh release download + tar with go install
  • Added GOPATH/bin to $GITHUB_PATH
  • Changed ./dependabot to dependabot (now on PATH)
  • Simplified smoke test YAML download to a single gh api call with Accept: application/vnd.github.raw header (was two HTTP requests)

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.
Copilot AI review requested due to automatic review settings March 9, 2026 18:33
./dependabot --version
URL="https://api.github.com/repos/dependabot/smoke-tests/contents/tests/smoke-${SUITE}.yaml"
curl $(gh api "$URL" --jq .download_url) -o smoke.yaml
gh api "repos/dependabot/smoke-tests/contents/tests/smoke-${SUITE}.yaml" -H "Accept: application/vnd.github.raw" > smoke.yaml
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this saves an http call over the curl wrapping gh api

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the smoke test workflow by replacing gh release download + tar extraction of the Dependabot CLI with go install, leveraging Go being pre-installed on ubuntu-latest runners. It also streamlines the smoke test YAML download from a two-request pattern (gh api + curl) to a single gh api call using the Accept: application/vnd.github.raw header.

Changes:

  • Replaced CLI binary download via gh release download and tar extraction with go install github.com/dependabot/cli/cmd/dependabot@latest, adding GOPATH/bin to $GITHUB_PATH
  • Simplified smoke test YAML download to a single gh api call with a raw content Accept header
  • Updated ./dependabot references to dependabot (now resolved via PATH)

@jeffwidman jeffwidman merged commit 88bb005 into main Mar 9, 2026
163 of 183 checks passed
@jeffwidman jeffwidman deleted the replace-gh-release-with-go-install branch March 9, 2026 20:03
Comment on lines +38 to +39
- name: Add Go bin to PATH
run: echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants