mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-03-29 01:49:53 +00:00
Fix latest-version workflow check (#812)
## Summary - make the latest-version workflow test use the action output for the exact installed version - allow `uv --version` to include additional platform/build metadata - keep validating that the reported version matches the latest GitHub release ## Testing - npm ci --ignore-scripts - npm run all - actionlint .github/workflows/test.yml Fixes the failure in https://github.com/astral-sh/setup-uv/actions/runs/23332230171/job/67866051063
This commit is contained in:
committed by
GitHub
parent
c20049fc26
commit
8cc8d1cbfc
18
.github/workflows/test.yml
vendored
18
.github/workflows/test.yml
vendored
@@ -164,10 +164,22 @@ jobs:
|
|||||||
- name: Latest version gets installed
|
- name: Latest version gets installed
|
||||||
run: |
|
run: |
|
||||||
LATEST_VERSION=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/astral-sh/uv/releases/latest | jq -r '.tag_name')
|
LATEST_VERSION=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/astral-sh/uv/releases/latest | jq -r '.tag_name')
|
||||||
|
UV_VERSION_OUTPUT=$(uv --version)
|
||||||
|
|
||||||
|
if [[ ! "$UV_VERSION_OUTPUT" =~ ^uv[[:space:]]+([^[:space:]]+) ]]; then
|
||||||
|
echo "Could not parse uv version from: $UV_VERSION_OUTPUT"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
UV_VERSION="${BASH_REMATCH[1]}"
|
||||||
|
|
||||||
echo "Latest version is $LATEST_VERSION"
|
echo "Latest version is $LATEST_VERSION"
|
||||||
if [ "$(uv --version)" != "uv $LATEST_VERSION" ]; then
|
echo "uv --version output is $UV_VERSION_OUTPUT"
|
||||||
echo "Wrong uv version: $(uv --version)"
|
echo "Parsed uv version is $UV_VERSION"
|
||||||
exit 1
|
|
||||||
|
if [ "$UV_VERSION" != "$LATEST_VERSION" ]; then
|
||||||
|
echo "Wrong uv version: $UV_VERSION_OUTPUT"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
Reference in New Issue
Block a user