Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,35 @@ jobs:
shell: bash
run: |
if [[ "${{ matrix.platform }}" == 'windows' ]]; then
echo "PRERELEASE=false" >> $GITHUB_ENV
case "${{ matrix.arch }}" in
"amd64") FILENAME="treefmt-x86_64-pc-windows-msvc.zip";;
"arm64") FILENAME="treefmt-aarch64-pc-windows-msvc.zip";;
*) echo "Unsupported platform/arch combination" && exit 1;;
esac
TREEFMT_VERSION="v0.6.1"
LATEST="false"
Comment on lines +66 to +67

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

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

The hardcoded version "v0.6.1" for Windows platforms differs significantly from the latest release behavior used for other platforms. This creates inconsistency and makes maintenance harder. Consider adding a comment explaining why Windows requires this specific older version, or better yet, align all platforms to use the same versioning strategy if possible.

Suggested change
TREEFMT_VERSION="v0.6.1"
LATEST="false"
TREEFMT_VERSION=""
LATEST="true"

Copilot uses AI. Check for mistakes.
else
echo "PRERELEASE=true" >> $GITHUB_ENV
case "${{ matrix.platform }}-${{ matrix.arch }}" in
"linux-amd64") FILENAME="treefmt_2.0.0-rc*_linux_amd64.tar.gz";;
"linux-arm64") FILENAME="treefmt_2.0.0-rc*_linux_arm64.tar.gz";;
"darwin-amd64") FILENAME="treefmt_2.0.0-rc*_darwin_amd64.tar.gz";;
"darwin-arm64") FILENAME="treefmt_2.0.0-rc*_darwin_arm64.tar.gz";;
"linux-amd64") FILENAME="treefmt_*_linux_amd64.tar.gz";;
"linux-arm64") FILENAME="treefmt_*_linux_arm64.tar.gz";;
"darwin-amd64") FILENAME="treefmt_*_darwin_amd64.tar.gz";;
"darwin-arm64") FILENAME="treefmt_*_darwin_arm64.tar.gz";;
*) echo "Unsupported platform/arch combination" && exit 1;;
esac
TREEFMT_VERSION=""
LATEST="true"
fi
echo "FILENAME=$FILENAME" >> $GITHUB_ENV
echo "TREEFMT_VERSION=$TREEFMT_VERSION" >> $GITHUB_ENV
echo "LATEST=$LATEST" >> $GITHUB_ENV

- name: Download treefmt
id: download-release
uses: robinraju/release-downloader@v1.10
with:
repository: "numtide/treefmt"
latest: true
preRelease: ${{ env.PRERELEASE }}
latest: ${{ env.LATEST }}
tag: ${{ env.TREEFMT_VERSION }}
Comment on lines +88 to +89

Copilot AI Dec 15, 2025

Copy link

Choose a reason for hiding this comment

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

When latest is set to true, providing an empty string for tag may cause ambiguous behavior. For non-Windows platforms where LATEST is true and TREEFMT_VERSION is empty, consider omitting the tag parameter entirely or restructuring the logic to use either latest or tag, but not both simultaneously. This would make the intent clearer and align better with the action's API design.

Copilot uses AI. Check for mistakes.
fileName: ${{ env.FILENAME }}
out-file-path: "downloads"
extract: true
Expand Down