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
@@ -252,7 +254,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
252
254
253
255
When you specify just the major version or the version in `major.minor` format, the latest patch version matching the input will be setup.
254
256
255
-
Except for major versions of `composer`, For other tools when you specify only the `major` version or the version in `major.minor` format for any 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"). You can do that by setting `COMPOSER_TOKEN` environment variable.
257
+
Except for major versions of `composer`, For other tools when you specify only the `major` version or the version in `major.minor` format for any 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"). 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 a future release.
256
258
257
259
```yaml
258
260
- name: Setup PHP with tools
@@ -261,7 +263,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
261
263
php-version: '8.1'
262
264
tools: php-cs-fixer:3.5, phpunit:9.5
263
265
env:
264
-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
266
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
265
267
```
266
268
267
269
- 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.
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 `COMPOSER_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.
743
+
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.
744
+
The `COMPOSER_TOKEN` key has been deprecated in favor of `GITHUB_TOKEN` and will be removed in the next major version.
742
745
743
746
```yaml
744
747
- name: Setup PHP
745
748
uses: shivammathur/setup-php@v2
746
749
with:
747
750
php-version: '8.1'
748
751
env:
749
-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
752
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
753
+
```
754
+
755
+
### Private Packagist Authentication
756
+
757
+
If you use Private Packagist for your private composer dependencies, you can set the `PACKAGIST_TOKEN` environment variable to authenticate.
758
+
759
+
```yaml
760
+
- name: Setup PHP
761
+
uses: shivammathur/setup-php@v2
762
+
with:
763
+
php-version: '8.1'
764
+
env:
765
+
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
766
+
```
767
+
768
+
### Manual Composer Authentication
769
+
770
+
In addition to GitHub or Private Packagist, if you want to authenticate private repositories hosted elsewhere, you can set the `COMPOSER_AUTH_JSON` environment variable with the authentication methods and the credentials in json format.
771
+
Please refer to the authentication section in [`composer documentation`](https://getcomposer.org/doc/articles/authentication-for-private-packages.md "composer documentation") for more details.
0 commit comments