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
+50-4
Original file line number
Diff line number
Diff line change
@@ -209,14 +209,54 @@ execution if it does not find a lock file.
209
209
210
210
### Fork and private repositories
211
211
212
-
Sometimes it's needed to use the `repositories` key in your `composer.json` to pull in forks, PRs with patches or private repositories. In this case, your GitHub Action may start failing with a `Could not authenticate against github.com` error message. To solve this, you need to add a GitHub Personal Access token, and this bit to your Action configuration:
212
+
Sometimes it's necessary to use the `repositories` key in your `composer.json` to
213
+
pull in forks, PRs with patches, or private repositories. In this case, your
214
+
GitHub Action may start failing with a `Could not authenticate against github.com`
215
+
error message. To solve this, you need to use an authorized token. Luckily,
216
+
[GHA provides you with one automatically at each run][]; all you need to do is
217
+
set the `repository-projects` permission to `read`:
In this example, `COMPOSER_AUTH` is the name of the secret that you'll need to create. To access public repositories, the `public_repo` scope is sufficient, while for private repositories (that you can access), `read:project` will be needed.
218
257
219
-
For more information on how to do that on your repository, see [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) and [Creating encrypted secrets for a repository](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) on GitHub documentation.
258
+
For more information on how to do that on your repository, see [Creating a personal access token][]
259
+
and [Creating encrypted secrets for a repository][] on GitHub documentation.
220
260
221
261
### Matrix Example
222
262
@@ -263,3 +303,9 @@ yourself with [CONTRIBUTING.md](CONTRIBUTING.md).
and licensed for use under the terms of the MIT License (MIT). Please see
265
305
[LICENSE](LICENSE) for more information.
306
+
307
+
308
+
[GHA provides you with one automatically at each run]: https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication
309
+
[default environment variable that Composer supports]: https://getcomposer.org/doc/articles/authentication-for-private-packages.md#authentication-using-the-composer-auth-environment-variable
310
+
[Creating a personal access token]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
311
+
[Creating encrypted secrets for a repository]: https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository
0 commit comments