You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-19Lines changed: 9 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,19 +258,6 @@ These tools can be set up globally using the `tools` input. It accepts a string
258
258
259
259
When you specify just the major version or the version in `major.minor` format, the latest patch version matching the input will be setup.
260
260
261
-
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").
262
-
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.
263
-
264
-
```yaml
265
-
- name: Setup PHP with tools
266
-
uses: shivammathur/setup-php@v2
267
-
with:
268
-
php-version: '8.4'
269
-
tools: php-cs-fixer:3.64, phpunit:11.4
270
-
env:
271
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
272
-
```
273
-
274
261
- The latest stable version of `composer` is set up by default. You can set up the required `composer` version by specifying the major version `v1` or `v2`, or the version in `major.minor` or `semver` format. Additionally, for composer `snapshot` and `preview` can also be specified to set up the respective releases.
275
262
276
263
```yaml
@@ -473,6 +460,12 @@ Disable coverage for these reasons:
473
460
- Accepts a `string` in csv-format. For example: `phpunit, phpcs`
474
461
- See [tools support](#wrench-tools-support) for tools supported.
475
462
463
+
#### `github-token` (optional)
464
+
465
+
- Specify the GitHub token to use for authentication.
466
+
- Accepts a `string`.
467
+
- By default, `GITHUB_TOKEN` secret provided by GitHub Actions is used.
If you have a number of workflows which set up multiple tools or have many composer dependencies, you might hit the GitHub's rate limit for composer. Also, if you specify only the major version or the version in `major.minor` format, you can hit the rate limit. To avoid this you can specify an `OAuth` token by setting `GITHUB_TOKEN` environment variable. You can use [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token "GITHUB_TOKEN documentation") secret for this purpose.
798
+
By default, setup-php uses the `GITHUB_TOKEN` secret that is generated for each workflow run. In case you want to use a Personal Access Token (PAT) instead, you can set the `github-token` input.
808
799
809
-
The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHUB_TOKEN` and will be removed in the next major version.
800
+
The `COMPOSER_TOKEN` and `GITHUB_TOKEN` environment variables have been deprecated in favor of the `github-token` input and will be removed in the next major version.
0 commit comments