Support all valid PHP version file values (#1121)

* Support all valid PHP version file values

Allow version files to use partial versions and aliases accepted by the
php-version input while preserving support for both plain .php-version
files and asdf-style php entries.

* Regenerate bundled action

---------

Co-authored-by: Shivam Mathur <shivam_jpr@hotmail.com>
This commit is contained in:
Sviatoslav AbakumovandShivam Mathur authored and GitHub committed 2026-09-17 20:17:54 +05:30
1 parent e3f88f3ca7
commit 0bbee91078
3 files changed
+8 -2

No files matched your search

+6
View File
@@ -334,6 +334,12 @@ describe('Utils tests', () => {
readFileSync.mockReturnValue('ruby 1.2.3\nphp 8.4.2\nnode 20.1.2');
expect(await utils.readPHPVersion()).toBe('8.4.2');
readFileSync.mockReturnValue('ruby 1.2.3\nphp 8.4\nnode 20.1.2');
expect(await utils.readPHPVersion()).toBe('8.4');
readFileSync.mockReturnValue('ruby 1.2.3\nphp latest\nnode 20.1.2');
expect(await utils.readPHPVersion()).toBe('latest');
existsSync.mockReturnValue(true);
readFileSync.mockReturnValue('setup-php');
await expect(utils.readPHPVersion()).rejects.toThrow('Invalid PHP version');