Commit Graph

98 Commits

Author SHA1 Message Date
Keisuke Maeda 8ca9579834 Add support for pinning tools to a checksum (#1098)
Tools in the tools input can now be pinned to a checksum using the
tool:version@sha256:<hash> or tool:version@sha512:<hash> syntax.
The downloaded tool is verified against the checksum on all platforms,
including when it is served from the tools cache, and it is removed
along with its cache entry if the verification fails.

Checksum verification is supported for tools downloaded as phar
archives. Specifying a checksum for tools set up using composer
packages or custom package scripts results in an error.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 18:15:59 +05:30
Shivam Mathur eeef37e059 GHSA-pqwm-q9pv-ph8r - Fix CWE-78 [skip ci] 2026-05-14 08:58:36 +05:30
Shivam Mathur 7748c24380 GHSA-f9f8-rm49-7jv2: Fix GitHub auth handling for composer in affected versions 2026-05-13 16:19:11 +05:30
theluckystrike 746e1a46d1 fix: use latest in URL when version is empty
When version is not specified (empty string), the getUrl function
was generating invalid URLs like /releases/download/cs2pr without
any version, which returned 404.

This fix ensures that when version is empty or 'latest', the URL
includes '/latest/' which GitHub handles correctly with a redirect
to the actual latest release.

Fixes #1063
2026-03-04 22:03:38 +07:00
Shivam Mathur 46cb5030ab Replace generic record interfaces with specific ones 2026-01-21 02:46:20 +05:30
Shivam Mathur 871ff01b2b Refactor to use ES2024+ features for Node 24
Use Set for O(1) redirect status code lookup in fetch.ts

Use at(-1) and Object.hasOwn() in tools.ts

Use for...of with entries() in utils.ts
2026-01-20 06:46:28 +05:30
Shivam Mathur 46ae35f333 Update to Node 24
Update fetch.ts to use native fetch() API

Use immutable sort in tools.ts
2026-01-20 06:29:00 +05:30
Shivam Mathur 91d37511e3 Fix fallback to latest version in tools.ts 2025-11-26 06:25:09 +05:30
Shivam Mathur 2c40db3599 Fix getcomposer fallback url for specific versions 2025-11-21 01:02:19 +05:30
Shivam Mathur bf6b4fbd49 Improve sorting in tools.getSemverVersion 2025-09-18 16:30:57 +05:30
Shivam Mathur 8f8196743c Fix sorting in tools.getSemverVersion 2025-09-17 19:06:59 +05:30
Shivam Mathur dfcda83968 Add fallback url for composer 2025-09-04 20:26:04 +05:30
Shivam Mathur 0f7f1d08e3 Upgrade to Jest 30 2025-06-13 02:06:31 +05:30
Christoph M. Becker c954e9c756 Lock Phive version for PHP 7.3/7.4
Latest Phive (0.16.0) claims to require PHP 8.0 or later[1].  While I
have not found any issues running it under PHP 7.4, it might be better
to stick with Phive 0.15.3 for PHP 7.3/7.4.

[1] <https://github.com/phar-io/phive/releases/tag/0.16.0>
2025-06-03 14:35:02 +02:00
Shivam Mathur 3bfebc13bc Add fallback url for phpunit tools 2025-02-07 05:40:29 +05:30
Shivam Mathur a4e22b60bb Bump version to 2.30.0 2024-03-01 12:06:41 +05:30
Shivam Mathur 7fdd3ece87 Fix blackfire-player on Linux and macOS
Drop support for blackfire-player on Windows
2023-09-14 02:51:49 +05:30
Shivam Mathur 9d529a72e0 Only check castor version if castor.php is present 2023-06-24 02:25:43 +05:30
Shivam Mathur c63f07d82e Fix version prefix for castor 2023-06-23 23:28:05 +05:30
Loïck Piera 7ce22e0264 Add support for jolicode/castor 2023-06-23 16:13:17 +02:00
Shivam Mathur d2f333de6f Fix regression in major/minor.major version support for phpunit 2023-06-13 03:16:19 +05:30
Shivam Mathur 6cc8b47c6f Add support to fetch tool versions from packagist 2023-06-12 15:27:46 +05:30
amnuts 4630172078 Added what should be compensation for phpunit versions 2023-06-12 15:27:20 +05:30
Shivam Mathur bbc65d999a Fix extension logs
Refactor utils.addCommand
2023-01-18 09:00:28 +05:30
Shivam Mathur 6db1a06425 Improve support for blackfire-player 2023-01-17 05:11:26 +05:30
Shivam Mathur cf5cd90b4c Improve support for composer authenticating private respositories 2022-07-06 12:19:55 +05:30
Shivam Mathur 74d43be8a3 Fix support for deployer 2022-05-31 10:12:38 +05:30
Shivam Mathur 32d20248ae Improve support for composer fallback URLs 2022-04-23 11:57:06 +05:30
Shivam Mathur 94c859a50e Add GitHub releases fallback URL for phing 2022-03-01 20:44:20 +05:30
Shivam Mathur 4dc94c27cf Refactor utils.fetch to a module and mock it with nock
Add redirect support in utils.fetch
2022-02-06 10:53:40 +05:30
Shivam Mathur 71d07ee7f4 Update symfony-cli support to use new symfony-cli/symfony-cli 2022-01-29 11:27:44 +05:30
Shivam Mathur cad2a1bda3 Rename os_version => os 2022-01-29 05:29:58 +05:30
Shivam Mathur 63c7766312 Remove unnecessary writing of scripts to RUNNER_TOOL_CACHE 2022-01-29 04:40:49 +05:30
Shivam Mathur 1db2ec93f3 Fix tools.getLatestVersion 2022-01-27 08:44:53 +05:30
Shivam Mathur f24f33ea89 Scope binary tools installed using composer 2021-12-31 00:11:33 +05:30
Shivam Mathur 0f13e29d1f Use composer phars from cache with PHP version 2021-12-22 20:07:07 +05:30
Shivam Mathur dab0e73adf Refactor addPhive in tools.ts 2021-12-13 08:11:59 +05:30
Shivam Mathur 15b20027cf Use GitHub releases for phive's latest version 2021-12-13 07:47:57 +05:30
Shivam Mathur 4d3cfaa653 Fixed support for php-cs-fixer
Added fetch_latest to tools.json. When fetch_latest is true for a tool
it will fetch the release.atom for the tool and parse that to get the
latest release.

Bumped lib version to ES2020 in tsconfig.json for string.matchAll.
2021-08-20 09:14:39 +05:30
Shivam Mathur 7bd9f10bef Add no_tools_cache flag 2021-08-18 09:53:25 +05:30
jrfnl f31d416e6e Update Phive configuration
Phive has released version `0.15.0` which ups the minimum supported PHP version to PHP 7.3.

This adds the switch statement for Phive to take this into account.

Ref: https://github.com/phar-io/phive/releases
2021-08-01 19:52:48 +02:00
Shivam Mathur 09e08a3554 More fixes in fetching tool versions 2021-07-14 14:17:32 +05:30
Shivam Mathur 7eec3d790d Fix repeated version_prefix 2021-07-10 02:10:33 +05:30
Shivam Mathur 14fa980966 Improve error handling in utils.fetch and its uses
Minor fixes in tests

Revert to ES2019
2021-07-09 11:26:38 +05:30
Shivam Mathur e1a9afe11c Add support to specify major or major.minor versions for tools with GitHub repository 2021-07-07 22:40:03 +05:30
Shivam Mathur 6449431df2 Move tools config to tools.json
Refactor tools functions to use Records and object literals
2021-07-07 22:40:02 +05:30
Shivam Mathur 60ff774608 Fix replacing v prefix in tool version 2021-07-07 22:40:01 +05:30
Shivam Mathur 55ab748aaa Update dependencies
Update to Jest 27

Set sourceMap to true in tsconfig.json
2021-06-04 21:34:31 +05:30
Shivam Mathur 8cfcbb030f Add support for tools: none 2021-04-21 17:11:24 +05:30
Shivam Mathur 23393c46d7 Add support for composer packages using tools input 2021-04-19 17:05:59 +05:30