mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-04 06:03:17 +07:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
7aefaa0b54 | |||
048eb79ef3 | |||
29247235f0 | |||
e84efebd6e | |||
0f7f1d08e3 | |||
433bdeeaf0 | |||
1c5378302c | |||
c251c791ff | |||
36fada6981 |
@ -258,7 +258,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
|
||||
When you specify just the major version or the version in `major.minor` format, the latest patch version matching the input will be setup.
|
||||
|
||||
With the exception of major versions of `composer`, if you specify only the `major` version or the version in `major.minor` format for a tool you can get rate limited by GitHub's API. To avoid this, it is recommended to provide a [`GitHub` OAuth token](https://github.com/shivammathur/setup-php#composer-github-oauth "Composer GitHub OAuth").
|
||||
With the exception of major versions of `composer`, if you specify only the `major` version or the version in `major.minor` format for a tool you can get rate limited by GitHub's API. To avoid this, it is recommended to provide a [`GitHub` OAuth token](https://github.com/shivammathur/setup-php#github-composer-authentication "Composer GitHub OAuth").
|
||||
You can do that by setting `GITHUB_TOKEN` environment variable. The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHUB_TOKEN` and will be removed in the next major version.
|
||||
|
||||
```yaml
|
||||
@ -278,7 +278,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
tools: composer:v2
|
||||
tools: composer:v1
|
||||
```
|
||||
|
||||
- If you do not use composer in your workflow, you can specify `tools: none` to skip it.
|
||||
|
5166
package-lock.json
generated
5166
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-php",
|
||||
"version": "2.34.0",
|
||||
"version": "2.34.1",
|
||||
"private": false,
|
||||
"description": "Setup PHP for use with GitHub Actions",
|
||||
"main": "lib/install.js",
|
||||
@ -40,25 +40,25 @@
|
||||
"compare-versions": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^1.2.9",
|
||||
"@eslint/compat": "^1.3.0",
|
||||
"@eslint/js": "9.28.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^22.15.30",
|
||||
"@typescript-eslint/eslint-plugin": "^8.33.1",
|
||||
"@typescript-eslint/parser": "^8.33.1",
|
||||
"@types/node": "^24.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.34.0",
|
||||
"@typescript-eslint/parser": "^8.34.0",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"eslint": "9.28.0",
|
||||
"eslint-config-prettier": "^10.1.5",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-jest": "^28.13.0",
|
||||
"eslint-plugin-jest": "^28.13.3",
|
||||
"eslint-plugin-prettier": "^5.4.1",
|
||||
"globals": "^16.2.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
"jest": "^30.0.0",
|
||||
"jest-circus": "^30.0.0",
|
||||
"nock": "^14.0.5",
|
||||
"prettier": "^3.5.3",
|
||||
"simple-git-hooks": "^2.13.0",
|
||||
"ts-jest": "^29.3.4",
|
||||
"ts-jest": "^29.4.0",
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"bugs": {
|
||||
|
@ -212,7 +212,7 @@ get_scan_dir() {
|
||||
|
||||
# Function to handle self-hosted runner setup.
|
||||
self_hosted_helper() {
|
||||
:
|
||||
sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
# Function to Setup PHP.
|
||||
|
@ -20,6 +20,7 @@ self_hosted_helper() {
|
||||
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
||||
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
|
||||
fi
|
||||
sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true
|
||||
install_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg
|
||||
}
|
||||
|
||||
|
@ -110,11 +110,11 @@ release_lock() {
|
||||
# Function to get the SHA256 hash of a string.
|
||||
get_sha256() {
|
||||
local input=$1
|
||||
if command -v sha256sum >/dev/null 2>&1; then
|
||||
if command -v sha256sum >/dev/null; then
|
||||
printf '%s' "$input" | sha256sum | cut -d' ' -f1
|
||||
elif command -v shasum >/dev/null 2>&1; then
|
||||
elif command -v shasum >/dev/null; then
|
||||
printf '%s' "$input" | shasum -a 256 | cut -d' ' -f1
|
||||
elif command -v openssl >/dev/null 2>&1; then
|
||||
elif command -v openssl >/dev/null; then
|
||||
printf '%s' "$input" | openssl dgst -sha256 | cut -d' ' -f2
|
||||
fi
|
||||
}
|
||||
@ -221,7 +221,7 @@ self_hosted_setup() {
|
||||
exit 1
|
||||
else
|
||||
self_hosted_helper >/dev/null 2>&1
|
||||
add_env RUNNER_TOOL_CACHE /tmp
|
||||
add_env RUNNER_TOOL_CACHE /opt/hostedtoolcache
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
@ -419,6 +419,7 @@ export async function addPhive(data: RS): Promise<string> {
|
||||
* @param data
|
||||
*/
|
||||
export async function addPHPUnitTools(data: RS): Promise<string> {
|
||||
/* istanbul ignore next */
|
||||
if (data['version'] === 'latest') {
|
||||
data['version'] =
|
||||
(await packagist.search(data['packagist'], data['php_version'])) ??
|
||||
|
@ -456,6 +456,7 @@ export async function readPHPVersion(): Promise<string> {
|
||||
const composerLock = path.join(composerProjectDir, 'composer.lock');
|
||||
if (fs.existsSync(composerLock)) {
|
||||
const lockFileContents = JSON.parse(fs.readFileSync(composerLock, 'utf8'));
|
||||
/* istanbul ignore next */
|
||||
if (
|
||||
lockFileContents['platform-overrides'] &&
|
||||
lockFileContents['platform-overrides']['php']
|
||||
@ -469,6 +470,7 @@ export async function readPHPVersion(): Promise<string> {
|
||||
const composerFileContents = JSON.parse(
|
||||
fs.readFileSync(composerJson, 'utf8')
|
||||
);
|
||||
/* istanbul ignore next */
|
||||
if (
|
||||
composerFileContents['config'] &&
|
||||
composerFileContents['config']['platform'] &&
|
||||
|
Reference in New Issue
Block a user