Fix shfmt installation to use versioned release URLs#8
Merged
Conversation
The shfmt release assets use versioned filenames (shfmt_vX.Y.Z_linux_amd64), so the unversioned path returned 404. Now queries the GitHub API for the latest tag before constructing the download URL. https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV
The curl approach fails due to GitHub API rate limiting on unauthenticated runner requests, leaving the version variable empty. go install is simpler and reliable since Go is pre-installed on ubuntu-latest. https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV
go install succeeds but $GOPATH/bin is not in PATH for subsequent steps on ubuntu-latest runners. Appending to GITHUB_PATH makes shfmt available. https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV
Convert 2-space indentation to tabs and reformat case statement arms to match shfmt's default style, so CI's shfmt -d check passes. https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV
- Move shebang from line 2 to line 1 in all setup/install/*.sh scripts so shellcheck can detect bash and correctly lint them - Add SC1091 disable directives for sourced external scripts (nvm, homeshick) - Fix SC2164: add || exit 1 after cd in nvim-install.sh and neovim.sh https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV
- SC1091: add disable directives before source "$SCRIPT_DIR/lib.sh" in all scripts (path uses variable, shellcheck can't resolve statically) - SC2034: OS and ARCH are set in lib.sh and used by sourcing scripts; suppress false-positive unused-variable warnings - SC2005: replace echo "$(uname -m)" with plain uname -m - SC2016: suppress single-quote $SHELL warning in intentional literal printf https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updated the CI workflow to dynamically fetch the latest shfmt version and use the correct versioned release URL format for installation.
Key Changes
/latest/downloadredirectshfmt_linux_amd64toshfmt_{VERSION}_linux_amd64to match the actual release artifact naming conventionImplementation Details
The previous approach used GitHub's
/latest/downloadredirect which may not work reliably in all environments. The new approach:tag_namefield to extract the versionhttps://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV