Skip to content

Commit 00d163e

Browse files
authored
Skip setup-uv if uv is already installed (#53)
* Skip setup-uv if uv is already installed Signed-off-by: William Woodruff <william@astral.sh> * Bump Dependabot intervals Signed-off-by: William Woodruff <william@astral.sh> * Document existing behavior Signed-off-by: William Woodruff <william@astral.sh> --------- Signed-off-by: William Woodruff <william@astral.sh>
1 parent 19f02f3 commit 00d163e

3 files changed

Lines changed: 27 additions & 5 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: github-actions
44
directory: /
55
schedule:
6-
interval: weekly
6+
interval: monthly
77
cooldown:
88
default-days: 7
99
groups:
@@ -13,7 +13,7 @@ updates:
1313
- package-ecosystem: "uv"
1414
directory: "/"
1515
schedule:
16-
interval: "weekly"
16+
interval: "monthly"
1717
cooldown:
1818
default-days: 7
1919
groups:

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ a publishing tool that supports PEP 740 attestations. Such tools include:
7171
> We recommend using `uv publish` with this action, as it does not require
7272
> any additional installation or configuration.
7373

74+
> [!TIP]
75+
> This action will attempt to install `uv` if it is not already installed
76+
> and available on the `PATH`.
77+
7478
### Quickstart
7579

7680
Add `astral-sh/attest-action` directly above your publishing step in your

action.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
name: astral-sh/attest-action
22

3-
description: A GitHub Action that generates PEP 740 publish attestations for your Python packages.
3+
description: |
4+
A GitHub Action that generates PEP 740 publish attestations for
5+
your Python packages.
46
57
inputs:
68
paths:
7-
description: One or more whitespace-separated directories or glob patterns to search for Python distributions to generate attestations for.
9+
description: |
10+
One or more whitespace-separated directories or glob patterns to
11+
search for Python distributions to generate attestations for.
812
required: false
913
default: dist/*
1014
overwrite:
11-
description: Whether to overwrite existing attestations if they already exist.
15+
description: |
16+
Whether to overwrite existing attestations if they already exist.
1217
required: false
1318
default: "false"
1419

@@ -17,8 +22,21 @@ outputs: {}
1722
runs:
1823
using: composite
1924
steps:
25+
- name: check if uv is already installed
26+
id: check-uv
27+
run: |
28+
if ! command -v uv > /dev/null; then
29+
echo "::notice::uv is not installed, this action will install it"
30+
echo "install_needed=true" >> $GITHUB_OUTPUT
31+
else
32+
echo "::debug::uv is already installed"
33+
echo "install_needed=false" >> $GITHUB_OUTPUT
34+
fi
35+
shell: bash
36+
2037
- name: setup uv
2138
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
39+
if: steps.check-uv.outputs.install_needed == 'true'
2240
with:
2341
version: ">=0.9.12"
2442
cache-dependency-glob: ${{ github.action_path }}/uv.lock

0 commit comments

Comments
 (0)