File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,21 @@ From `$client` object, you can access the full Private Packagist API.
169169
170170Full documentation can be found in the [ Private Packagist documentation] ( https://packagist.com/docs/api ) .
171171
172+ ### Trusted publishing
173+
174+ To upload artifact files, trusted publishing can be used in certain environment like GitHub Actions without the need to
175+ configure authentication via API key and secret.
176+
177+ ``` php
178+ $fileName = 'package1.zip';
179+ $file = file_get_contents($fileName);
180+ $client = new \PrivatePackagist\ApiClient\Client();
181+ $client->authenticateWithTrustedPublishing('acme-org', 'acme/package');
182+ $client->packages()->artifacts()->add('acme/package', $file, 'application/zip', $fileName);
183+ ```
184+
185+ We recommend using the [ GitHub action] ( https://github.com/packagist/artifact-publish-github-action ) directly.
186+
172187### Organization
173188
174189#### Trigger a full synchronization
You can’t perform that action at this time.
0 commit comments