5
0
mirror of https://github.com/astral-sh/setup-uv.git synced 2025-12-15 11:07:14 +00:00

Compare commits

...

54 Commits

Author SHA1 Message Date
Kevin Stillhammer
5f42d5af6c Replace v3 with v4 in README.md (#176) 2024-11-28 20:49:05 +00:00
Kevin Stillhammer
26ddfef6e1 Add matrix example for python-version (#175) 2024-11-28 20:46:52 +00:00
Kevin Stillhammer
ee4fa33003 Add input python-version (#174) 2024-11-28 20:41:37 +00:00
Kevin Stillhammer
420915557e Reduce test matrices (#173)
Basic functionality for the different OS is tested in
`test-latest-version` Everything else is not OS dependent
2024-11-28 21:07:46 +01:00
github-actions[bot]
9839fa9fb5 chore: update known checksums for 0.5.5 (#170)
chore: update known checksums for 0.5.5

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-11-27 19:28:03 +01:00
Kevin Stillhammer
196fe5f098 Speed up updating known checksums (#166)
Before downloading the checksum file from the releases, check if we
already know that version.
2024-11-25 09:18:03 +01:00
Kevin Stillhammer
49d8a3d9a8 Clarify caching will only fail when enabled and nothing to cache (#165) 2024-11-23 16:24:42 +00:00
Kevin Stillhammer
d8db0a86d3 Change some formulations in README.md (#164) 2024-11-23 15:47:24 +00:00
Kevin Stillhammer
ed171c292b Fail when cache local path does not exist when trying to cache (#163)
Can be disabled by setting `ignore-nothing-to-cache: true`
2024-11-23 16:30:54 +01:00
Kevin Stillhammer
691a091485 Remove working dir from cacheDependencyGlob error message (#162)
Since https://github.com/astral-sh/setup-uv/pull/160 we allow searching
everywhere
2024-11-23 11:03:08 +00:00
Kevin Stillhammer
9b71657bb2 Add comment to clarify process.exit(0) (#161)
Copied from https://github.com/actions/cache/pull/1217
2024-11-23 10:58:21 +00:00
Kevin Stillhammer
caf0cab7a6 Expand TILDE (~) in path inputs (#160)
Closes: #159
2024-11-23 09:21:51 +01:00
github-actions[bot]
7c238111e6 chore: update known checksums for 0.5.4 (#158)
chore: update known checksums for 0.5.4

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-11-20 22:32:28 +00:00
dependabot[bot]
3eca4c2715 Bump @types/node from 22.9.0 to 22.9.1 (#157)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.9.0 to 22.9.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.9.0&new-version=22.9.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-20 16:02:30 +01:00
github-actions[bot]
aee2e918ee chore: update known checksums for 0.5.3 (#156)
chore: update known checksums for 0.5.3

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-11-19 22:03:11 +00:00
dependabot[bot]
4ffb6d766c Bump @vercel/ncc from 0.38.2 to 0.38.3 (#155)
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.2 to
0.38.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/vercel/ncc/releases"><code>@​vercel/ncc</code>'s
releases</a>.</em></p>
<blockquote>
<h2>0.38.3</h2>
<h2><a
href="https://github.com/vercel/ncc/compare/0.38.2...0.38.3">0.38.3</a>
(2024-11-15)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>add missing <code>--asset-builds</code> to cli help message (<a
href="https://redirect.github.com/vercel/ncc/issues/1228">#1228</a>) (<a
href="84f8c52872">84f8c52</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="84f8c52872"><code>84f8c52</code></a>
fix: add missing <code>--asset-builds</code> to cli help message (<a
href="https://redirect.github.com/vercel/ncc/issues/1228">#1228</a>)</li>
<li><a
href="0ff93c67f8"><code>0ff93c6</code></a>
chore(deps): Bump elliptic from 6.5.7 to 6.6.0 (<a
href="https://redirect.github.com/vercel/ncc/issues/1223">#1223</a>)</li>
<li><a
href="ae5bf16cb3"><code>ae5bf16</code></a>
chore(deps): Bump amannn/action-semantic-pull-request from 5.3.0 to
5.5.3 (<a
href="https://redirect.github.com/vercel/ncc/issues/1">#1</a>...</li>
<li><a
href="738a2bfe3d"><code>738a2bf</code></a>
chore(deps-dev): Bump axios from 0.21.4 to 1.7.7 (<a
href="https://redirect.github.com/vercel/ncc/issues/1209">#1209</a>)</li>
<li>See full diff in <a
href="https://github.com/vercel/ncc/compare/0.38.2...0.38.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@vercel/ncc&package-manager=npm_and_yarn&previous-version=0.38.2&new-version=0.38.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-15 11:15:58 +01:00
github-actions[bot]
e779db7426 chore: update known checksums for 0.5.2 (#154)
chore: update known checksums for 0.5.2

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-11-15 06:53:19 +00:00
github-actions[bot]
cb1ce8a914 chore: update known checksums for 0.5.1 (#152)
chore: update known checksums for 0.5.1

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-11-09 11:01:15 +01:00
github-actions[bot]
cf7bbf8f13 chore: update known checksums for 0.5.0 (#151)
chore: update known checksums for 0.5.0

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-11-08 09:39:20 +01:00
Kevin Stillhammer
2e657c127d Avoid leftover files by using temp dir (#150)
Fixes: #149
2024-11-06 12:52:46 +01:00
dependabot[bot]
a7e15805d2 Bump @actions/cache from 3.2.4 to 3.3.0 (#143)
Bumps
[@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache)
from 3.2.4 to 3.3.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md"><code>@​actions/cache</code>'s
changelog</a>.</em></p>
<blockquote>
<h3>3.3.0</h3>
<ul>
<li>Update <code>@actions/core</code> to <code>1.11.1</code></li>
<li>Remove dependency on <code>uuid</code> package <a
href="https://redirect.github.com/actions/toolkit/pull/1824">#1824</a>,
<a
href="https://redirect.github.com/actions/toolkit/pull/1842">#1842</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/actions/toolkit/commits/HEAD/packages/cache">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@actions/cache&package-manager=npm_and_yarn&previous-version=3.2.4&new-version=3.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 20:57:00 +00:00
dependabot[bot]
2a578ce17f Bump @types/node from 22.8.6 to 22.9.0 (#146)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.8.6 to 22.9.0.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.8.6&new-version=22.9.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-05 21:48:02 +01:00
Kevin Stillhammer
6f467a02b3 add archive extension to downloaded assets (#148)
Fixes missing .zip extensions
which breaks on old PowerShell versions

Fixes: #147
2024-11-05 21:21:57 +01:00
github-actions[bot]
d2242d1901 chore: update known checksums for 0.4.30 (#145)
chore: update known checksums for 0.4.30

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-11-05 06:55:55 +00:00
dependabot[bot]
5552ab3709 Bump @types/node from 22.7.9 to 22.8.6 (#142)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.7.9 to 22.8.6.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.7.9&new-version=22.8.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-02 14:48:47 +01:00
github-actions[bot]
3e4fe09ab3 chore: update known checksums for 0.4.29 (#140)
chore: update known checksums for 0.4.29

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-10-31 08:15:34 +00:00
github-actions[bot]
56f89d8124 chore: update known checksums for 0.4.28 (#136)
chore: update known checksums for 0.4.28

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-10-29 09:22:48 +00:00
Merlin
3b9817b1bf feat: add option to disable cache pruning (#134)
This PR adds an input to control whether or not the cache is pruned
before saving.

Closes #122

---------

Co-authored-by: Kevin Stillhammer <kevin.stillhammer@gmail.com>
Co-authored-by: Charlie Marsh <crmarsh416@gmail.com>
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-10-25 14:11:32 +02:00
dependabot[bot]
cf841c25e2 Bump @types/node from 22.7.8 to 22.7.9 (#132)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.7.8 to 22.7.9.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.7.8&new-version=22.7.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-24 09:58:30 +02:00
github-actions[bot]
864c48a352 chore: update known checksums for 0.4.26 (#133)
chore: update known checksums for 0.4.26

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-10-24 07:53:38 +00:00
dependabot[bot]
64311bdf43 Bump @types/node from 22.7.7 to 22.7.8 (#131)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.7.7 to 22.7.8.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.7.7&new-version=22.7.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-22 12:36:29 +02:00
github-actions[bot]
59604e6118 chore: update known checksums for 0.4.25 (#130)
chore: update known checksums for 0.4.25

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-10-21 12:21:15 +00:00
dependabot[bot]
260f4a22de Bump @types/node from 22.7.6 to 22.7.7 (#129)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.7.6 to 22.7.7.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.7.6&new-version=22.7.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 13:16:28 +02:00
Trevor Manz
273d3782a2 Use 0.4.x for versioning examples (#128)
I figured having the syntax examples with the latest minor semver would
be more convenient for copy pasting.
2024-10-18 12:35:52 -04:00
dependabot[bot]
ed0a39790e Bump @types/node from 22.7.5 to 22.7.6 (#123)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.7.5 to 22.7.6.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.7.5&new-version=22.7.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-18 13:19:40 +02:00
dependabot[bot]
2d11fcb2c1 Bump @biomejs/biome from 1.9.3 to 1.9.4 (#127)
Bumps
[@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome)
from 1.9.3 to 1.9.4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/biomejs/biome/releases"><code>@​biomejs/biome</code>'s
releases</a>.</em></p>
<blockquote>
<h2>CLI v1.9.4</h2>
<h3>Analyzer</h3>
<h4>Bug fixes</h4>
<ul>
<li>
<p>Improved the message for unused suppression comments. Contributed by
<a href="https://github.com/dyc3"><code>@​dyc3</code></a></p>
</li>
<li>
<p>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/4228">#4228</a>,
where the rule
<code>a11y/noInteractiveElementToNoninteractiveRole</code> incorrectly
reports a <code>role</code> for non-interactive elements. Contributed by
<a href="https://github.com/eryue0220"><code>@​eryue0220</code></a></p>
</li>
<li>
<p><code>noSuspiciousSemicolonInJsx</code> now catches suspicious
semicolons in React fragments. Contributed by <a
href="https://github.com/vasucp1207"><code>@​vasucp1207</code></a></p>
</li>
</ul>
<h3>CLI</h3>
<h4>Enhancements</h4>
<ul>
<li>
<p>The <code>--summary</code> reporter now reports parsing diagnostics
too. Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></p>
</li>
<li>
<p>Improved performance of GritQL queries by roughly 25-30%. Contributed
by <a href="https://github.com/arendjr"><code>@​arendjr</code></a></p>
</li>
</ul>
<h3>Configuration</h3>
<h4>Bug fixes</h4>
<ul>
<li>Fix an issue where the JSON schema marked lint rules options as
mandatory. Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></li>
</ul>
<h3>Formatter</h3>
<h4>Bug fixes</h4>
<ul>
<li>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/4121">#4121</a>.
Respect line width when printing multiline strings. Contributed by <a
href="https://github.com/ah-yu"><code>@​ah-yu</code></a></li>
</ul>
<h3>Linter</h3>
<h4>New features</h4>
<ul>
<li>Add <a
href="https://biomejs.dev/linter/rules/use-guard-for-in/">useGuardForIn</a>.
Contributed by <a
href="https://github.com/fireairforce"><code>@​fireairforce</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-document-cookie/">noDocumentCookie</a>.
Contributed by <a
href="https://github.com/tunamaguro"><code>@​tunamaguro</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-document-import-in-page/">noDocumentImportInPage</a>.
Contributed by <a
href="https://github.com/kaioduarte"><code>@​kaioduarte</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-duplicate-properties/">noDuplicateProperties</a>.
Contributed by <a
href="https://github.com/togami2864"><code>@​togami2864</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-head-element/">noHeadElement</a>.
Contributed by <a
href="https://github.com/kaioduarte"><code>@​kaioduarte</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-head-import-in-document/">noHeadImportInDocument</a>.
Contributed by <a
href="https://github.com/kaioduarte"><code>@​kaioduarte</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-img-element/">noImgElement</a>.
Contributed by <a
href="https://github.com/kaioduarte"><code>@​kaioduarte</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-unknown-type-selector/">noUnknownTypeSelector</a>.
Contributed by <a
href="https://github.com/Kazuhiro-Mimaki"><code>@​Kazuhiro-Mimaki</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/use-at-index/">useAtIndex</a>.
Contributed by <a
href="https://github.com/GunseiKPaseri"><code>@​GunseiKPaseri</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-useless-string-raw/">noUselessStringRaw</a>.
Contributed by <a
href="https://github.com/fireairforce"><code>@​fireairforce</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/use-collapsed-if/">nursery/useCollapsedIf</a>.
Contributed by <a
href="https://github.com/siketyan"><code>@​siketyan</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/use-google-font-display/">useGoogleFontDisplay</a>.
Contributed by <a
href="https://github.com/kaioduarte"><code>@​kaioduarte</code></a></li>
</ul>
<h4>Bug Fixes</h4>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/biomejs/biome/blob/main/CHANGELOG.md"><code>@​biomejs/biome</code>'s
changelog</a>.</em></p>
<blockquote>
<h2>v1.9.4 (2024-10-17)</h2>
<h3>Analyzer</h3>
<h4>Bug fixes</h4>
<ul>
<li>
<p>Improved the message for unused suppression comments. Contributed by
<a href="https://github.com/dyc3"><code>@​dyc3</code></a></p>
</li>
<li>
<p>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/4228">#4228</a>,
where the rule
<code>a11y/noInteractiveElementToNoninteractiveRole</code> incorrectly
reports a <code>role</code> for non-interactive elements. Contributed by
<a href="https://github.com/eryue0220"><code>@​eryue0220</code></a></p>
</li>
<li>
<p><code>noSuspiciousSemicolonInJsx</code> now catches suspicious
semicolons in React fragments. Contributed by <a
href="https://github.com/vasucp1207"><code>@​vasucp1207</code></a></p>
</li>
</ul>
<h3>CLI</h3>
<h4>Enhancements</h4>
<ul>
<li>
<p>The <code>--summary</code> reporter now reports parsing diagnostics
too. Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></p>
</li>
<li>
<p>Improved performance of GritQL queries by roughly 25-30%. Contributed
by <a href="https://github.com/arendjr"><code>@​arendjr</code></a></p>
</li>
</ul>
<h3>Configuration</h3>
<h4>Bug fixes</h4>
<ul>
<li>Fix an issue where the JSON schema marked lint rules options as
mandatory. Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></li>
</ul>
<h3>Editors</h3>
<h3>Formatter</h3>
<h4>Bug fixes</h4>
<ul>
<li>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/4121">#4121</a>.
Respect line width when printing multiline strings. Contributed by <a
href="https://github.com/ah-yu"><code>@​ah-yu</code></a></li>
</ul>
<h3>JavaScript APIs</h3>
<h3>Linter</h3>
<h4>New features</h4>
<ul>
<li>Add <a
href="https://biomejs.dev/linter/rules/use-guard-for-in/">useGuardForIn</a>.
Contributed by <a
href="https://github.com/fireairforce"><code>@​fireairforce</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-document-cookie/">noDocumentCookie</a>.
Contributed by <a
href="https://github.com/tunamaguro"><code>@​tunamaguro</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-document-import-in-page/">noDocumentImportInPage</a>.
Contributed by <a
href="https://github.com/kaioduarte"><code>@​kaioduarte</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-duplicate-properties/">noDuplicateProperties</a>.
Contributed by <a
href="https://github.com/togami2864"><code>@​togami2864</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-head-element/">noHeadElement</a>.
Contributed by <a
href="https://github.com/kaioduarte"><code>@​kaioduarte</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-head-import-in-document/">noHeadImportInDocument</a>.
Contributed by <a
href="https://github.com/kaioduarte"><code>@​kaioduarte</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-img-element/">noImgElement</a>.
Contributed by <a
href="https://github.com/kaioduarte"><code>@​kaioduarte</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-unknown-type-selector/">noUnknownTypeSelector</a>.
Contributed by <a
href="https://github.com/Kazuhiro-Mimaki"><code>@​Kazuhiro-Mimaki</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/use-at-index/">useAtIndex</a>.
Contributed by <a
href="https://github.com/GunseiKPaseri"><code>@​GunseiKPaseri</code></a></li>
<li>Add <a
href="https://biomejs.dev/linter/rules/no-useless-string-raw/">noUselessStringRaw</a>.
Contributed by <a
href="https://github.com/fireairforce"><code>@​fireairforce</code></a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fa93a147ab"><code>fa93a14</code></a>
release: v1.9.4 (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4320">#4320</a>)</li>
<li><a
href="2a05cd47fd"><code>2a05cd4</code></a>
feat(lint): add <code>useGoogleFontDisplay</code> rule (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4264">#4264</a>)</li>
<li><a
href="bbb93b98b4"><code>bbb93b9</code></a>
feat(lint): useCollapsedIf JS lint rule (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4179">#4179</a>)</li>
<li><a
href="561b54c936"><code>561b54c</code></a>
feat(linter): implement noUselessStringRaw (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4263">#4263</a>)</li>
<li><a
href="5b7d1581c5"><code>5b7d158</code></a>
feat(linter): implement <code>noDuplicateProperties</code> (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4029">#4029</a>)</li>
<li><a
href="2342984b92"><code>2342984</code></a>
feat(lint): add <code>noDocumentImportInPage</code> rule (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4265">#4265</a>)</li>
<li><a
href="3cf20ebb81"><code>3cf20eb</code></a>
chore(linter): rename <code>useExplicitFunctionReturnType</code> to
`useExplicit… (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4261">#4261</a>)</li>
<li><a
href="970f49884e"><code>970f498</code></a>
feat(useGuardForIn): add rule (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4104">#4104</a>)</li>
<li><a
href="2e5b6564d9"><code>2e5b656</code></a>
feat(lint): add <code>noDocumentCookie</code> rule (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4204">#4204</a>)</li>
<li><a
href="3364640e1f"><code>3364640</code></a>
feat(lint): add rule <code>useAtIndex</code> (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4120">#4120</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/biomejs/biome/commits/cli/v1.9.4/packages/@biomejs/biome">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@biomejs/biome&package-manager=npm_and_yarn&previous-version=1.9.3&new-version=1.9.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-18 13:11:13 +02:00
github-actions[bot]
a714a3589c chore: update known checksums for 0.4.24 (#126)
chore: update known checksums for 0.4.24

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-10-18 09:02:22 +00:00
github-actions[bot]
59ca521371 chore: update known checksums for 0.4.23 (#125)
chore: update known checksums for 0.4.23

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-10-17 15:44:41 +00:00
Kevin Stillhammer
f3bcaebff5 Update deps (#121)
Fixes: https://github.com/astral-sh/setup-uv/issues/119
2024-10-15 11:33:59 +00:00
github-actions[bot]
10d8740fc2 chore: update known checksums for 0.4.21 (#120)
chore: update known checksums for 0.4.21

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-10-15 10:00:41 +00:00
Yoshihisa Mochihara
f731690a1d Fix cache linebreak in linux runner (#118)
Related https://github.com/astral-sh/setup-uv/issues/106

We can see the differences `uv --version` in different platforms:

OSX: uv 0.4.20 (0e1b25a53 2024-10-08)\n
Linux: uv 0.4.20\n

In getVersion function we split the output by space and return the
second part.
This PR trims the version number to remove the line break.
2024-10-12 08:59:22 +02:00
github-actions[bot]
77c28f02b3 chore: update known checksums for 0.4.20 (#115)
chore: update known checksums for 0.4.20

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-10-09 09:55:25 +02:00
dependabot[bot]
00c695b84c Bump @types/node from 22.7.4 to 22.7.5 (#114)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.7.4 to 22.7.5.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.7.4&new-version=22.7.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 13:21:35 +02:00
github-actions[bot]
2422c84f47 chore: update known checksums for 0.4.19 (#113)
chore: update known checksums for 0.4.19

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-10-08 05:35:45 +00:00
dependabot[bot]
680950fd0f Bump @biomejs/biome from 1.9.2 to 1.9.3 (#110)
Bumps
[@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome)
from 1.9.2 to 1.9.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/biomejs/biome/releases"><code>@​biomejs/biome</code>'s
releases</a>.</em></p>
<blockquote>
<h2>CLI v1.9.3</h2>
<h3>CLI</h3>
<h4>New features</h4>
<ul>
<li>
<p>GritQL queries that match functions or methods will now match async
functions or methods as well.</p>
<p>If this is not what you want, you can capture the <code>async</code>
keyword (or its absence) in a metavariable and assert its emptiness:</p>
<pre lang="grit"><code>$async function foo() {} where $async &lt;: .
</code></pre>
<p>Contributed by <a
href="https://github.com/arendjr"><code>@​arendjr</code></a></p>
</li>
</ul>
<h4>Bug fixes</h4>
<ul>
<li>
<p>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/4077">#4077</a>:
Grit queries no longer need to match the statement's trailing semicolon.
Contributed by <a
href="https://github.com/arendjr"><code>@​arendjr</code></a></p>
</li>
<li>
<p>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/4102">#4102</a>.
Now the CLI command <code>lint</code> doesn't exit with an error code
when using <code>--write</code>/<code>--fix</code>. Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></p>
</li>
</ul>
<h3>Configuration</h3>
<h4>Bug fixes</h4>
<ul>
<li>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/4125">#4125</a>,
where <code>noLabelWithoutControl</code> options where incorrectly
marked as mandatory. Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></li>
</ul>
<h3>Editors</h3>
<ul>
<li>Fix a case where CSS files weren't correctly linted using the
default configuration. Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></li>
</ul>
<h3>Formatter</h3>
<h4>Bug fixes</h4>
<ul>
<li>
<p>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/3924">#3924</a>
where GraphQL formatter panics in block comments with empty line.
Contributed by <a
href="https://github.com/vohoanglong0107"><code>@​vohoanglong0107</code></a></p>
</li>
<li>
<p>Fix a case where raw values inside <code>url()</code> functions
weren't properly trimmed.</p>
<pre lang="diff"><code>.value {
-  background: url(
-   whitespace-around-string
-  );
+ background: url(whitespace-around-string);
}
</code></pre>
<p>Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></p>
</li>
<li>
<p>Fixed <a
href="https://redirect.github.com/biomejs/biome/issues/4076">#4076</a>,
where a media query wasn't correctly formatted:</p>
<pre lang="diff"><code>.class {
</code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/biomejs/biome/blob/main/CHANGELOG.md"><code>@​biomejs/biome</code>'s
changelog</a>.</em></p>
<blockquote>
<h2>v1.9.3 (2024-10-01)</h2>
<h3>CLI</h3>
<h4>New features</h4>
<ul>
<li>
<p>GritQL queries that match functions or methods will now match async
functions or methods as well.</p>
<p>If this is not what you want, you can capture the <code>async</code>
keyword (or its absence) in a metavariable and assert its emptiness:</p>
<pre lang="grit"><code>$async function foo() {} where $async &lt;: .
</code></pre>
<p>Contributed by <a
href="https://github.com/arendjr"><code>@​arendjr</code></a></p>
</li>
</ul>
<h4>Bug fixes</h4>
<ul>
<li>
<p>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/4077">#4077</a>:
Grit queries no longer need to match the statement's trailing semicolon.
Contributed by <a
href="https://github.com/arendjr"><code>@​arendjr</code></a></p>
</li>
<li>
<p>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/4102">#4102</a>.
Now the CLI command <code>lint</code> doesn't exit with an error code
when using <code>--write</code>/<code>--fix</code>. Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></p>
</li>
</ul>
<h3>Configuration</h3>
<h4>Bug fixes</h4>
<ul>
<li>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/4125">#4125</a>,
where <code>noLabelWithoutControl</code> options where incorrectly
marked as mandatory. Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></li>
</ul>
<h3>Editors</h3>
<ul>
<li>Fix a case where CSS files weren't correctly linted using the
default configuration. Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></li>
</ul>
<h3>Formatter</h3>
<h4>Bug fixes</h4>
<ul>
<li>
<p>Fix <a
href="https://redirect.github.com/biomejs/biome/issues/3924">#3924</a>
where GraphQL formatter panics in block comments with empty line.
Contributed by <a
href="https://github.com/vohoanglong0107"><code>@​vohoanglong0107</code></a></p>
</li>
<li>
<p>Fix a case where raw values inside <code>url()</code> functions
weren't properly trimmed.</p>
<pre lang="diff"><code>.value {
-  background: url(
-   whitespace-around-string
-  );
+ background: url(whitespace-around-string);
}
</code></pre>
<p>Contributed by <a
href="https://github.com/ematipico"><code>@​ematipico</code></a></p>
</li>
<li>
<p>Fixed <a
href="https://redirect.github.com/biomejs/biome/issues/4076">#4076</a>,
where a media query wasn't correctly formatted:</p>
<pre lang="diff"><code></code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3d498ed639"><code>3d498ed</code></a>
release: v1.9.3 (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4140">#4140</a>)</li>
<li><a
href="7e29f06930"><code>7e29f06</code></a>
fix(lint): options for <code>noLabelWithoutControl</code> are optional
(<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4138">#4138</a>)</li>
<li><a
href="10a1371dca"><code>10a1371</code></a>
feat(useExhaustiveDependencies): add option to disable errors for
unecessary ...</li>
<li><a
href="295efb90b9"><code>295efb9</code></a>
feat(biome_css_analyze): implement <code>noDescendingSpecificity</code>
(<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4097">#4097</a>)</li>
<li><a
href="f3cfa8a92d"><code>f3cfa8a</code></a>
fix(schema): make optional the <code>options</code> JSON schema field
(<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4080">#4080</a>)</li>
<li><a
href="cc4c867575"><code>cc4c867</code></a>
feat(linter): implement noTemplateCurlyInString (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4069">#4069</a>)</li>
<li><a
href="d03c6cd029"><code>d03c6cd</code></a>
feat(linter): implement no-nested-ternary (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4067">#4067</a>)</li>
<li><a
href="2b6b3c8aa9"><code>2b6b3c8</code></a>
chore(deps): update <a
href="https://github.com/biomejs"><code>@​biomejs</code></a> packages
(<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4047">#4047</a>)</li>
<li><a
href="b76cb416da"><code>b76cb41</code></a>
feat(linter): implement useExplicitFunctionReturnType (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/3990">#3990</a>)</li>
<li><a
href="a766aebd6c"><code>a766aeb</code></a>
chore(readme): use polar shield (<a
href="https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome/issues/4000">#4000</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/biomejs/biome/commits/cli/v1.9.3/packages/@biomejs/biome">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@biomejs/biome&package-manager=npm_and_yarn&previous-version=1.9.2&new-version=1.9.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 07:22:05 +02:00
github-actions[bot]
c9aa747934 chore: update known checksums for 0.4.18 (#109)
chore: update known checksums for 0.4.18

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-10-02 09:37:03 +00:00
dependabot[bot]
97dc6041e9 Bump @types/node from 22.7.3 to 22.7.4 (#108)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.7.3 to 22.7.4.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.7.3&new-version=22.7.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-02 09:44:49 +02:00
Charlie Marsh
c11f8674f8 Migrate to Biome for linting and formatting (#107) 2024-09-30 08:55:24 +02:00
github-actions[bot]
023eb7875f chore: update known checksums for 0.4.17 (#104)
chore: update known checksums for 0.4.17

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-09-27 20:26:47 +02:00
dependabot[bot]
315da29189 Bump @types/node from 22.7.0 to 22.7.3 (#103)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.7.0 to 22.7.3.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.7.0&new-version=22.7.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-27 13:05:44 +02:00
dependabot[bot]
4cda7d7332 Bump @types/node from 22.6.1 to 22.7.0 (#101)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.6.1 to 22.7.0.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.6.1&new-version=22.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-25 13:02:33 +02:00
github-actions[bot]
8114e5e81b chore: update known checksums for 0.4.16 (#100)
chore: update known checksums for 0.4.16

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2024-09-25 07:25:31 +00:00
dependabot[bot]
7ee921e18a Bump @types/node from 22.5.5 to 22.6.1 (#98)
Bumps
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
from 22.5.5 to 22.6.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=22.5.5&new-version=22.6.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-25 09:02:25 +02:00
Kevin Stillhammer
8c3a35e468 Only log checksum is valid when it really is (#97) 2024-09-21 19:10:22 +00:00
25 changed files with 8883 additions and 12225 deletions

View File

@@ -1,4 +0,0 @@
dist/
lib/
node_modules/
jest.config.js

View File

@@ -1,61 +0,0 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"i18n-text/no-en": "off",
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ "accessibility": "no-public" }
],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{ "allowExpressions": true }
],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}

View File

@@ -11,10 +11,7 @@ concurrency:
jobs:
test-setup-cache:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup with cache
@@ -25,10 +22,7 @@ jobs:
- run: uv sync
working-directory: __tests__\fixtures\uv-project
test-restore-cache:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
runs-on: windows-latest
needs: test-setup-cache
steps:
- uses: actions/checkout@v4

View File

@@ -11,24 +11,18 @@ concurrency:
jobs:
test-setup-cache:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-14]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup with cache
uses: ./
with:
enable-cache: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache
- run: uv sync
working-directory: __tests__/fixtures/uv-project
test-restore-cache:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-14]
runs-on: ubuntu-latest
needs: test-setup-cache
steps:
- uses: actions/checkout@v4
@@ -37,7 +31,7 @@ jobs:
uses: ./
with:
enable-cache: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache
- name: Cache was hit
run: |
if [ "$CACHE_HIT" != "true" ]; then
@@ -59,7 +53,7 @@ jobs:
cache-dependency-glob: |
__tests__/fixtures/uv-project/uv.lock
**/pyproject.toml
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-dependency-glob
- run: uv sync
working-directory: __tests__/fixtures/uv-project
test-restore-cache-dependency-glob:
@@ -79,7 +73,8 @@ jobs:
cache-dependency-glob: |
__tests__/fixtures/uv-project/uv.lock
**/pyproject.toml
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-dependency-glob
ignore-nothing-to-cache: true
- name: Cache was not hit
run: |
if [ "$CACHE_HIT" == "true" ]; then
@@ -96,7 +91,7 @@ jobs:
uses: ./
with:
enable-cache: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-local
cache-local-path: /tmp/uv-cache
- run: uv sync
working-directory: __tests__/fixtures/uv-project
@@ -110,7 +105,7 @@ jobs:
uses: ./
with:
enable-cache: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-local
cache-local-path: /tmp/uv-cache
- name: Cache was hit
run: |
@@ -121,3 +116,49 @@ jobs:
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
- run: uv sync
working-directory: __tests__/fixtures/uv-project
test-tilde-expansion-cache-local-path:
runs-on: selfhosted-ubuntu-arm64
steps:
- uses: actions/checkout@v4
- name: Create cache directory
run: mkdir -p ~/uv-cache
shell: bash
- name: Setup with cache
uses: ./
with:
cache-local-path: ~/uv-cache/cache-local-path
- run: uv sync
working-directory: __tests__/fixtures/uv-project
test-tilde-expansion-cache-dependency-glob:
runs-on: selfhosted-ubuntu-arm64
steps:
- uses: actions/checkout@v4
- name: Create cache directory
run: mkdir -p ~/uv-cache
shell: bash
- name: Create cache dependency glob file
run: touch ~/uv-cache.glob
shell: bash
- name: Setup with cache
uses: ./
with:
enable-cache: true
cache-local-path: ~/uv-cache/cache-dependency-glob
cache-dependency-glob: "~/uv-cache.glob"
- run: uv sync
working-directory: __tests__/fixtures/uv-project
cleanup-tilde-expansion-tests:
needs:
- test-tilde-expansion-cache-local-path
- test-tilde-expansion-cache-dependency-glob
runs-on: selfhosted-ubuntu-arm64
steps:
- name: Remove cache directory
run: rm -rf ~/uv-cache
shell: bash
- name: Remove cache dependency glob file
run: rm -f ~/uv-cache.glob
shell: bash

View File

@@ -28,19 +28,18 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-14, selfhosted-ubuntu-arm64]
os: [ubuntu-latest, macos-latest, macos-14]
steps:
- uses: actions/checkout@v4
- name: Install default version
- name: Install latest version
uses: ./
- run: uv sync
working-directory: __tests__/fixtures/uv-project
test-specific-version:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-14, selfhosted-ubuntu-arm64]
uv-version: ["latest", "0.3.0", "0.3.2", "0.3", "0.3.x", ">=0.3.0"]
uv-version: ["0.3.0", "0.3.2", "0.3", "0.3.x", ">=0.3.0"]
steps:
- uses: actions/checkout@v4
- name: Install version ${{ matrix.uv-version }}
@@ -50,10 +49,7 @@ jobs:
- run: uv sync
working-directory: __tests__/fixtures/uv-project
test-semver-range:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, selfhosted-ubuntu-arm64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install version 0.3
@@ -72,15 +68,15 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, selfhosted-ubuntu-arm64]
os: [ubuntu-latest, macos-latest]
checksum:
["4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd"]
exclude:
- os: selfhosted-ubuntu-arm64
- os: macos-latest
checksum: "4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd"
include:
- os: selfhosted-ubuntu-arm64
checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"
- os: macos-latest
checksum: "a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218"
steps:
- uses: actions/checkout@v4
- name: Checksum matches expected
@@ -115,7 +111,6 @@ jobs:
macos-latest,
macos-14,
windows-latest,
selfhosted-ubuntu-arm64,
]
steps:
- uses: actions/checkout@v4
@@ -123,3 +118,24 @@ jobs:
uses: ./
- run: uv tool install ruff
- run: ruff --version
test-tilde-expansion-tool-dirs:
runs-on: selfhosted-ubuntu-arm64
steps:
- uses: actions/checkout@v4
- name: Setup with cache
uses: ./
with:
tool-bin-dir: "~/tool-bin-dir"
tool-dir: "~/tool-dir"
- name: "Check if tool dirs are expanded"
run: |
if ! echo "$PATH" | grep -q "/home/ubuntu/tool-bin-dir"; then
echo "PATH does not contain /home/ubuntu/tool-bin-dir: $PATH"
exit 1
fi
if [ "$UV_TOOL_DIR" != "/home/ubuntu/tool-dir" ]; then
echo "UV_TOOL_DIR does not contain /home/ubuntu/tool-dir: $UV_TOOL_DIR"
exit 1
fi

View File

@@ -1,3 +0,0 @@
dist/
lib/
node_modules/

View File

@@ -1,4 +0,0 @@
{
"trailingComma": "all",
"proseWrap": "always"
}

148
README.md
View File

@@ -14,13 +14,17 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
- [Install the latest version (default)](#install-the-latest-version-default)
- [Install a specific version](#install-a-specific-version)
- [Install a version by supplying a semver range](#install-a-version-by-supplying-a-semver-range)
- [Python version](#python-version)
- [Validate checksum](#validate-checksum)
- [Enable Caching](#enable-caching)
- [Cache dependency glob](#cache-dependency-glob)
- [Local cache path](#local-cache-path)
- [Disable cache pruning](#disable-cache-pruning)
- [Ignore nothing to cache](#ignore-nothing-to-cache)
- [GitHub authentication token](#github-authentication-token)
- [UV_TOOL_DIR](#uv_tool_dir)
- [UV_TOOL_BIN_DIR](#uv_tool_bin_dir)
- [Tilde Expansion](#tilde-expansion)
- [How it works](#how-it-works)
- [FAQ](#faq)
@@ -30,7 +34,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
```yaml
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
version: "latest"
```
@@ -40,7 +44,7 @@ For an example workflow, see
> [!TIP]
>
> Using `latest` requires that uv download the executable on every run, which incurs a cost
> Using `latest` requires to download the uv executable on every run, which incurs a cost
> (especially on self-hosted runners). As a best practice, consider pinning the version to a
> specific release.
@@ -48,39 +52,71 @@ For an example workflow, see
```yaml
- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
version: "0.4.4"
```
### Install a version by supplying a semver range
You can also specify a [semver range](https://github.com/npm/node-semver?tab=readme-ov-file#ranges)
You can specify a [semver range](https://github.com/npm/node-semver?tab=readme-ov-file#ranges)
to install the latest version that satisfies the range.
```yaml
- name: Install a semver range of uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
version: ">=0.3.0"
version: ">=0.4.0"
```
```yaml
- name: Pinning a minor version of uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
version: "0.3.x"
version: "0.4.x"
```
### Python version
You can use the input `python-version` to set the environment variable `UV_PYTHON` for the rest
of your workflow.
This will override any python version specifications in `pyproject.toml` and `.python-version`
```yaml
- name: Install the latest version of uv and set the python version to 3.12
uses: astral-sh/setup-uv@v4
with:
python-version: "3.12"
```
You can combine this with a matrix to test multiple python versions:
```yaml
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
- name: Test with python ${{ matrix.python-version }}
run: uv run --frozen pytest
```
### Validate checksum
You can also specify a checksum to validate the downloaded file. Checksums up to the default version
You can specify a checksum to validate the downloaded executable. Checksums up to the default version
are automatically verified by this action. The sha256 hashes can be found on the
[releases page](https://github.com/astral-sh/uv/releases) of the uv repo.
```yaml
- name: Install a specific version and validate the checksum
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
version: "0.3.1"
checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"
@@ -88,8 +124,8 @@ are automatically verified by this action. The sha256 hashes can be found on the
### Enable caching
If you enable caching, the [uv cache](https://docs.astral.sh/uv/concepts/cache/) will be cached to
the GitHub Actions Cache. This can speed up runs that reuse the cache by several minutes.
If you enable caching, the [uv cache](https://docs.astral.sh/uv/concepts/cache/) will be uploaded to
the GitHub Actions cache. This can speed up runs that reuse the cache by several minutes.
> [!TIP]
>
@@ -101,7 +137,7 @@ You can optionally define a custom cache key suffix.
```yaml
- name: Enable caching and define a custom cache key suffix
id: setup-uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-suffix: "optional-suffix"
@@ -118,9 +154,9 @@ use it in subsequent steps. For example, to use the cache in the above case:
#### Cache dependency glob
If you want to control when the cache is invalidated, specify a glob pattern with the
`cache-dependency-glob` input. The cache will be invalidated if any file matching the glob pattern
changes. The glob matches files relative to the repository root.
If you want to control when the GitHub Actions cache is invalidated, specify a glob pattern with the
`cache-dependency-glob` input. The GitHub Actions cache will be invalidated if any file matching the glob pattern
changes. If you use relative paths, they are relative to the repository root.
> [!NOTE]
>
@@ -128,7 +164,7 @@ changes. The glob matches files relative to the repository root.
```yaml
- name: Define a cache dependency glob
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "**/requirements*.txt"
@@ -136,7 +172,7 @@ changes. The glob matches files relative to the repository root.
```yaml
- name: Define a list of cache dependency globs
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: |
@@ -144,9 +180,17 @@ changes. The glob matches files relative to the repository root.
**/pyproject.toml
```
```yaml
- name: Define an absolute cache dependency glob
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "/tmp/my-folder/requirements*.txt"
```
```yaml
- name: Never invalidate the cache
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: ""
@@ -161,11 +205,44 @@ It defaults to `setup-uv-cache` in the `TMP` dir, `D:\a\_temp\uv-tool-dir` on Wi
```yaml
- name: Define a custom uv cache path
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
cache-local-path: "/path/to/cache"
```
### Disable cache pruning
By default, the uv cache is pruned after every run, removing pre-built wheels, but retaining any
wheels that were built from source. On GitHub-hosted runners, it's typically faster to omit those
pre-built wheels from the cache (and instead re-download them from the registry on each run).
However, on self-hosted or local runners, preserving the cache may be more efficient. See
the [documentation](https://docs.astral.sh/uv/concepts/cache/#caching-in-continuous-integration) for
more information.
If you want to persist the entire cache across runs, disable cache pruning with the `prune-cache`
input.
```yaml
- name: Don't prune the cache before saving it
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
prune-cache: false
```
### Ignore nothing to cache
By default, the action will fail if caching is enabled but there is nothing to upload (the uv cache directory does not exist).
If you want to ignore this, set the `ignore-nothing-to-cache` input to `true`.
```yaml
- name: Ignore nothing to cache
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
ignore-nothing-to-cache: true
```
### GitHub authentication token
This action uses the GitHub API to fetch the uv release artifacts. To avoid hitting the GitHub API
@@ -178,7 +255,7 @@ are not sufficient, you can provide a custom GitHub token with the necessary per
```yaml
- name: Install the latest version of uv with a custom GitHub token
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
```
@@ -196,7 +273,7 @@ input:
```yaml
- name: Install the latest version of uv with a custom tool dir
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
tool-dir: "/path/to/tool/dir"
```
@@ -215,11 +292,30 @@ If you want to change this behaviour (especially on self-hosted runners) you can
```yaml
- name: Install the latest version of uv with a custom tool bin dir
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
tool-bin-dir: "/path/to/tool-bin/dir"
```
### Tilde Expansion
This action supports expanding the `~` character to the user's home directory for the following inputs:
- `cache-local-path`
- `tool-dir`
- `tool-bin-dir`
- `cache-dependency-glob`
```yaml
- name: Expand the tilde character
uses: astral-sh/setup-uv@v4
with:
cache-local-path: "~/path/to/cache"
tool-dir: "~/path/to/tool/dir"
tool-bin-dir: "~/path/to/tool-bin/dir"
cache-dependency-glob: "~/my-cache-buster"
```
## How it works
This action downloads uv from the uv repo's official
@@ -244,7 +340,7 @@ For example:
- name: Checkout the repository
uses: actions/checkout@main
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Test
@@ -256,7 +352,7 @@ To install a specific version of Python, use
```yaml
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Install Python 3.12
@@ -275,7 +371,7 @@ output:
uses: actions/checkout@main
- name: Install the default version of uv
id: setup-uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
- name: Print the installed version
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
```

View File

@@ -6,6 +6,9 @@ inputs:
version:
description: "The version of uv to install"
default: "latest"
python-version:
description: "The version of Python to set UV_PYTHON to"
required: false
checksum:
description: "The checksum of the uv version to install"
required: false
@@ -29,6 +32,12 @@ inputs:
cache-local-path:
description: "Local path to store the cache."
default: ""
prune-cache:
description: "Prune cache before saving."
default: "true"
ignore-nothing-to-cache:
description: "Ignore when nothing is found to cache."
default: "false"
tool-dir:
description: "Custom path to set UV_TOOL_DIR to."
required: false

31
biome.json Normal file
View File

@@ -0,0 +1,31 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": ["dist", "lib", "node_modules"]
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"trailingCommas": "all"
}
}
}

3973
dist/save-cache/index.js generated vendored

File diff suppressed because one or more lines are too long

4573
dist/setup/index.js generated vendored

File diff suppressed because one or more lines are too long

4655
dist/update-known-checksums/index.js generated vendored

File diff suppressed because one or more lines are too long

6333
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,30 +6,25 @@
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"format": "prettier --write .",
"format-check": "prettier --check .",
"lint": "eslint src/**/*.ts --fix",
"format": "biome format --fix",
"format-check": "biome format",
"lint": "biome lint --fix",
"package": "ncc build -o dist/setup src/setup-uv.ts && ncc build -o dist/save-cache src/save-cache.ts && ncc build -o dist/update-known-checksums src/update-known-checksums.ts",
"test": "jest",
"act": "act pull_request -W .github/workflows/test.yml --container-architecture linux/amd64 -s GITHUB_TOKEN=\"$(gh auth token)\"",
"update-known-checksums": "node dist/update-known-checksums/index.js src/download/checksum/known-checksums.ts \"$(gh auth token)\"",
"update-known-checksums": "RUNNER_TEMP=known_checksums node dist/update-known-checksums/index.js src/download/checksum/known-checksums.ts \"$(gh auth token)\"",
"all": "npm run build && npm run format && npm run lint && npm run package && npm test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/astral-sh/setup-uv.git"
},
"keywords": [
"actions",
"python",
"setup",
"uv"
],
"keywords": ["actions", "python", "setup", "uv"],
"author": "@eifinger",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.2.4",
"@actions/core": "^1.10.1",
"@actions/cache": "^3.3.0",
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@actions/glob": "^0.5.0",
@@ -38,20 +33,13 @@
"@octokit/rest": "^21.0.2"
},
"devDependencies": {
"@types/node": "^22.5.5",
"@biomejs/biome": "1.9.4",
"@types/node": "^22.9.1",
"@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.18.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.1",
"eslint-plugin-github": "^5.0.2",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-prettier": "^5.2.1",
"@vercel/ncc": "^0.38.3",
"jest": "^29.7.0",
"js-yaml": "^4.1.0",
"prettier": "^3.3.3",
"ts-jest": "^29.2.5",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
}
}

View File

@@ -1,5 +1,4 @@
import * as cache from "@actions/cache";
import * as glob from "@actions/glob";
import * as core from "@actions/core";
import {
cacheDependencyGlob,
@@ -7,6 +6,7 @@ import {
cacheSuffix,
} from "../utils/inputs";
import { getArch, getPlatform } from "../utils/platforms";
import { hashFiles } from "../hash/hash-files";
export const STATE_CACHE_KEY = "cache-key";
export const STATE_CACHE_MATCHED_KEY = "cache-matched-key";
@@ -39,15 +39,10 @@ async function computeKeys(version: string): Promise<string> {
core.info(
`Searching files using cache dependency glob: ${cacheDependencyGlob.split("\n").join(",")}`,
);
cacheDependencyPathHash += await glob.hashFiles(
cacheDependencyGlob,
undefined,
undefined,
true,
);
cacheDependencyPathHash += await hashFiles(cacheDependencyGlob, true);
if (cacheDependencyPathHash === "-") {
throw new Error(
`No file in ${process.cwd()} matched to [${cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository`,
`No file matched to [${cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository`,
);
}
} else {

View File

@@ -1,9 +1,9 @@
import * as fs from "fs";
import * as crypto from "crypto";
import * as fs from "node:fs";
import * as crypto from "node:crypto";
import * as core from "@actions/core";
import { KNOWN_CHECKSUMS } from "./known-checksums";
import { Architecture, Platform } from "../../utils/platforms";
import type { Architecture, Platform } from "../../utils/platforms";
export async function validateChecksum(
checkSum: string | undefined,
@@ -12,11 +12,11 @@ export async function validateChecksum(
platform: Platform,
version: string,
): Promise<void> {
let isValid = true;
let isValid: boolean | undefined = undefined;
if (checkSum !== undefined && checkSum !== "") {
isValid = await validateFileCheckSum(downloadPath, checkSum);
} else {
core.debug(`Checksum not provided. Checking known checksums.`);
core.debug("Checksum not provided. Checking known checksums.");
const key = `${arch}-${platform}-${version}`;
if (key in KNOWN_CHECKSUMS) {
const knownChecksum = KNOWN_CHECKSUMS[`${arch}-${platform}-${version}`];
@@ -27,10 +27,12 @@ export async function validateChecksum(
}
}
if (!isValid) {
if (isValid === false) {
throw new Error(`Checksum for ${downloadPath} did not match ${checkSum}.`);
}
core.debug(`Checksum for ${downloadPath} is valid.`);
if (isValid === true) {
core.debug(`Checksum for ${downloadPath} is valid.`);
}
}
async function validateFileCheckSum(

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
import { promises as fs } from "fs";
import { promises as fs } from "node:fs";
import * as tc from "@actions/tool-cache";
import { KNOWN_CHECKSUMS } from "./known-checksums";
export async function updateChecksums(
filePath: string,
downloadUrls: string[],
@@ -7,31 +8,50 @@ export async function updateChecksums(
await fs.rm(filePath);
await fs.appendFile(
filePath,
"// AUTOGENERATED_DO_NOT_EDIT\nexport const KNOWN_CHECKSUMS: {[key: string]: string} = {\n",
"// AUTOGENERATED_DO_NOT_EDIT\nexport const KNOWN_CHECKSUMS: { [key: string]: string } = {\n",
);
let firstLine = true;
for (const downloadUrl of downloadUrls) {
const content = await downloadAssetContent(downloadUrl);
const checksum = content.split(" ")[0].trim();
const key = getKey(downloadUrl);
if (key === undefined) {
continue;
}
const checksum = await getOrDownloadChecksum(key, downloadUrl);
if (!firstLine) {
await fs.appendFile(filePath, ",\n");
}
await fs.appendFile(filePath, ` '${key}':\n '${checksum}'`);
await fs.appendFile(filePath, ` "${key}":\n "${checksum}"`);
firstLine = false;
}
await fs.appendFile(filePath, "}\n");
await fs.appendFile(filePath, ",\n};\n");
}
function getKey(downloadUrl: string): string {
function getKey(downloadUrl: string): string | undefined {
// https://github.com/astral-sh/uv/releases/download/0.3.2/uv-aarch64-apple-darwin.tar.gz.sha256
const parts = downloadUrl.split("/");
const fileName = parts[parts.length - 1];
if (fileName.startsWith("source")) {
return undefined;
}
const name = fileName.split(".")[0].split("uv-")[1];
const version = parts[parts.length - 2];
return `${name}-${version}`;
}
async function getOrDownloadChecksum(
key: string,
downloadUrl: string,
): Promise<string> {
let checksum = "";
if (key in KNOWN_CHECKSUMS) {
checksum = KNOWN_CHECKSUMS[key];
} else {
const content = await downloadAssetContent(downloadUrl);
checksum = content.split(" ")[0].trim();
}
return checksum;
}
async function downloadAssetContent(downloadUrl: string): Promise<string> {
const downloadPath = await tc.downloadTool(downloadUrl);
const content = await fs.readFile(downloadPath, "utf8");

View File

@@ -1,8 +1,9 @@
import * as core from "@actions/core";
import * as tc from "@actions/tool-cache";
import * as exec from "@actions/exec";
import * as path from "path";
import { Architecture, Platform } from "../utils/platforms";
import * as path from "node:path";
import { promises as fs } from "node:fs";
import type { Architecture, Platform } from "../utils/platforms";
import { validateChecksum } from "./checksum/checksum";
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";
@@ -13,12 +14,11 @@ export async function downloadLatest(
githubToken: string | undefined,
): Promise<{ cachedToolDir: string; version: string }> {
const artifact = `uv-${arch}-${platform}`;
let downloadUrl = `https://github.com/${OWNER}/${REPO}/releases/latest/download/${artifact}`;
let extension = ".tar.gz";
if (platform === "pc-windows-msvc") {
downloadUrl += ".zip";
} else {
downloadUrl += ".tar.gz";
extension = ".zip";
}
const downloadUrl = `https://github.com/${OWNER}/${REPO}/releases/latest/download/${artifact}${extension}`;
core.info(`Downloading uv from "${downloadUrl}" ...`);
const downloadPath = await tc.downloadTool(
@@ -29,7 +29,9 @@ export async function downloadLatest(
let uvExecutablePath: string;
let uvDir: string;
if (platform === "pc-windows-msvc") {
uvDir = await tc.extractZip(downloadPath);
const fullPathWithExtension = `${downloadPath}${extension}`;
await fs.copyFile(downloadPath, fullPathWithExtension);
uvDir = await tc.extractZip(fullPathWithExtension);
// On windows extracting the zip does not create an intermediate directory
uvExecutablePath = path.join(uvDir, "uv.exe");
} else {
@@ -67,5 +69,5 @@ async function getVersion(uvExecutablePath: string): Promise<string> {
};
await exec.exec(uvExecutablePath, execArgs, options);
const parts = output.split(" ");
return parts[1];
return parts[1].trim();
}

View File

@@ -1,8 +1,9 @@
import * as core from "@actions/core";
import * as tc from "@actions/tool-cache";
import * as path from "path";
import * as path from "node:path";
import { promises as fs } from "node:fs";
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";
import { Architecture, Platform } from "../utils/platforms";
import type { Architecture, Platform } from "../utils/platforms";
import { validateChecksum } from "./checksum/checksum";
import * as github from "@actions/github";
@@ -30,12 +31,11 @@ export async function downloadVersion(
): Promise<{ version: string; cachedToolDir: string }> {
const resolvedVersion = await resolveVersion(version, githubToken);
const artifact = `uv-${arch}-${platform}`;
let downloadUrl = `https://github.com/${OWNER}/${REPO}/releases/download/${resolvedVersion}/${artifact}`;
let extension = ".tar.gz";
if (platform === "pc-windows-msvc") {
downloadUrl += ".zip";
} else {
downloadUrl += ".tar.gz";
extension = ".zip";
}
const downloadUrl = `https://github.com/${OWNER}/${REPO}/releases/download/${resolvedVersion}/${artifact}${extension}`;
core.info(`Downloading uv from "${downloadUrl}" ...`);
const downloadPath = await tc.downloadTool(
@@ -53,7 +53,9 @@ export async function downloadVersion(
let uvDir: string;
if (platform === "pc-windows-msvc") {
uvDir = await tc.extractZip(downloadPath);
const fullPathWithExtension = `${downloadPath}${extension}`;
await fs.copyFile(downloadPath, fullPathWithExtension);
uvDir = await tc.extractZip(fullPathWithExtension);
// On windows extracting the zip does not create an intermediate directory
} else {
const extractedDir = await tc.extractTar(downloadPath);

48
src/hash/hash-files.ts Normal file
View File

@@ -0,0 +1,48 @@
import * as crypto from "node:crypto";
import * as core from "@actions/core";
import * as fs from "node:fs";
import * as stream from "node:stream";
import * as util from "node:util";
import { create } from "@actions/glob";
/**
* Hashes files matching the given glob pattern.
*
* Copied from https://github.com/actions/toolkit/blob/20ed2908f19538e9dfb66d8083f1171c0a50a87c/packages/glob/src/internal-hash-files.ts#L9-L49
* But supports hashing files outside the GITHUB_WORKSPACE.
* @param pattern The glob pattern to match files.
* @param verbose Whether to log the files being hashed.
*/
export async function hashFiles(
pattern: string,
verbose = false,
): Promise<string> {
const globber = await create(pattern);
let hasMatch = false;
const writeDelegate = verbose ? core.info : core.debug;
const result = crypto.createHash("sha256");
let count = 0;
for await (const file of globber.globGenerator()) {
writeDelegate(file);
if (fs.statSync(file).isDirectory()) {
writeDelegate(`Skip directory '${file}'.`);
continue;
}
const hash = crypto.createHash("sha256");
const pipeline = util.promisify(stream.pipeline);
await pipeline(fs.createReadStream(file), hash);
result.write(hash.digest());
count++;
if (!hasMatch) {
hasMatch = true;
}
}
result.end();
if (hasMatch) {
writeDelegate(`Found ${count} files to hash.`);
return result.digest("hex");
}
writeDelegate("No matches found for glob");
return "";
}

View File

@@ -1,22 +1,33 @@
import * as cache from "@actions/cache";
import * as core from "@actions/core";
import * as exec from "@actions/exec";
import * as fs from "node:fs";
import {
STATE_CACHE_MATCHED_KEY,
STATE_CACHE_KEY,
} from "./cache/restore-cache";
import { cacheLocalPath, enableCache } from "./utils/inputs";
import {
cacheLocalPath,
enableCache,
ignoreNothingToCache,
pruneCache as shouldPruneCache,
} from "./utils/inputs";
export async function run(): Promise<void> {
try {
if (enableCache) {
await saveCache();
// node will stay alive if any promises are not resolved,
// which is a possibility if HTTP requests are dangling
// due to retries or timeouts. We know that if we got here
// that all promises that we care about have successfully
// resolved, so simply exit with success.
process.exit(0);
}
} catch (error) {
const err = error as Error;
core.setFailed(err.message);
}
process.exit(0);
}
async function saveCache(): Promise<void> {
@@ -26,17 +37,38 @@ async function saveCache(): Promise<void> {
if (!cacheKey) {
core.warning("Error retrieving cache key from state.");
return;
} else if (matchedKey === cacheKey) {
}
if (matchedKey === cacheKey) {
core.info(`Cache hit occurred on key ${cacheKey}, not saving cache.`);
return;
}
await pruneCache();
if (shouldPruneCache) {
await pruneCache();
}
core.info(`Saving cache path: ${cacheLocalPath}`);
await cache.saveCache([cacheLocalPath], cacheKey);
core.info(`cache saved with the key: ${cacheKey}`);
if (!fs.existsSync(cacheLocalPath) && !ignoreNothingToCache) {
throw new Error(
`Cache path ${cacheLocalPath} does not exist on disk. This likely indicates that there are no dependencies to cache. Consider disabling the cache input if it is not needed.`,
);
}
try {
await cache.saveCache([cacheLocalPath], cacheKey);
core.info(`cache saved with the key: ${cacheKey}`);
} catch (e) {
if (
e instanceof Error &&
e.message ===
"Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved."
) {
core.info(
"No cacheable paths were found. Ignoring because ignore-nothing-to-save is enabled.",
);
} else {
throw e;
}
}
}
async function pruneCache(): Promise<void> {

View File

@@ -1,5 +1,5 @@
import * as core from "@actions/core";
import * as path from "path";
import * as path from "node:path";
import {
downloadVersion,
tryGetFromToolCache,
@@ -8,16 +8,17 @@ import { restoreCache } from "./cache/restore-cache";
import { downloadLatest } from "./download/download-latest";
import {
Architecture,
type Architecture,
getArch,
getPlatform,
Platform,
type Platform,
} from "./utils/platforms";
import {
cacheLocalPath,
checkSum,
enableCache,
githubToken,
pythonVersion,
toolBinDir,
toolDir,
version,
@@ -45,12 +46,13 @@ async function run(): Promise<void> {
addUvToPath(setupResult.uvDir);
addToolBinToPath();
setToolDir();
core.setOutput("uv-version", setupResult.version);
core.info(`Successfully installed uv version ${setupResult.version}`);
setupPython();
addMatchers();
setCacheDir(cacheLocalPath);
core.setOutput("uv-version", setupResult.version);
core.info(`Successfully installed uv version ${setupResult.version}`);
if (enableCache) {
await restoreCache(setupResult.version);
}
@@ -133,6 +135,13 @@ function setToolDir(): void {
}
}
function setupPython(): void {
if (pythonVersion !== "") {
core.exportVariable("UV_PYTHON", pythonVersion);
core.info(`Set UV_PYTHON to ${pythonVersion}`);
}
}
function setCacheDir(cacheLocalPath: string): void {
core.exportVariable("UV_CACHE_DIR", cacheLocalPath);
core.info(`Set UV_CACHE_DIR to ${cacheLocalPath}`);

View File

@@ -1,12 +1,16 @@
import * as core from "@actions/core";
import path from "path";
import path from "node:path";
export const version = core.getInput("version");
export const pythonVersion = core.getInput("python-version");
export const checkSum = core.getInput("checksum");
export const enableCache = core.getInput("enable-cache") === "true";
export const cacheSuffix = core.getInput("cache-suffix") || "";
export const cacheLocalPath = getCacheLocalPath();
export const cacheDependencyGlob = core.getInput("cache-dependency-glob");
export const pruneCache = core.getInput("prune-cache") === "true";
export const ignoreNothingToCache =
core.getInput("ignore-nothing-to-cache") === "true";
export const toolBinDir = getToolBinDir();
export const toolDir = getToolDir();
export const githubToken = core.getInput("github-token");
@@ -14,7 +18,7 @@ export const githubToken = core.getInput("github-token");
function getToolBinDir(): string | undefined {
const toolBinDirInput = core.getInput("tool-bin-dir");
if (toolBinDirInput !== "") {
return toolBinDirInput;
return expandTilde(toolBinDirInput);
}
if (process.platform === "win32") {
if (process.env.RUNNER_TEMP !== undefined) {
@@ -30,7 +34,7 @@ function getToolBinDir(): string | undefined {
function getToolDir(): string | undefined {
const toolDirInput = core.getInput("tool-dir");
if (toolDirInput !== "") {
return toolDirInput;
return expandTilde(toolDirInput);
}
if (process.platform === "win32") {
if (process.env.RUNNER_TEMP !== undefined) {
@@ -46,7 +50,7 @@ function getToolDir(): string | undefined {
function getCacheLocalPath(): string {
const cacheLocalPathInput = core.getInput("cache-local-path");
if (cacheLocalPathInput !== "") {
return cacheLocalPathInput;
return expandTilde(cacheLocalPathInput);
}
if (process.env.RUNNER_TEMP !== undefined) {
return `${process.env.RUNNER_TEMP}${path.sep}setup-uv-cache`;
@@ -55,3 +59,10 @@ function getCacheLocalPath(): string {
"Could not determine UV_CACHE_DIR. Please make sure RUNNER_TEMP is set or provide the cache-local-path input",
);
}
function expandTilde(input: string): string {
if (input.startsWith("~")) {
return `${process.env.HOME}${input.substring(1)}`;
}
return input;
}