mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
* Ensure `github-token` wins for `git-cli` pushes * more shenanigans * Default to GitHub API commit mode * e2e auth tests * push missing utils * rename input * refactor * refactor * refactor * refactor * refactor * refactor * reuse helpers * refactor * refactor * simplify * add tests * refactor * improve comments * shift helper * add comments * extract test helpers * update docs and changesets * update one thing
38 lines
2.6 KiB
Markdown
38 lines
2.6 KiB
Markdown
# changesets/action/publish
|
|
|
|
This action publishes packages to npm.
|
|
|
|
## Requirements
|
|
|
|
- Needs repo checked out and `@changesets/cli` installed
|
|
- [Job permissions][job-permissions]:
|
|
- `id-token: write`: if using [trusted publishing](https://docs.npmjs.com/trusted-publishers)
|
|
- [Workflow triggers][workflow-triggers]: _any_
|
|
|
|
## Usage
|
|
|
|
> [!TIP]
|
|
> Check out [the docs](https://changesets.dev/guide/automating#how-do-i-run-the-version-and-publish-commands) to learn how to set up the version and publish workflow.
|
|
|
|
## API
|
|
|
|
<!-- api-start -->
|
|
|
|
| Inputs | Description |
|
|
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| `github-token` | The GitHub token to use for authentication. Defaults to the GitHub-provided token. To use a custom token, pass it explicitly to this input. |
|
|
| `script` | The command to use to publish packages |
|
|
| `pack-dir-artifact-id` | Artifact id for packed publish output generated by the pack subaction |
|
|
| `create-github-releases` | Whether to create Github releases after publish |
|
|
| `push-git-tags` | Whether to create git tags after publish. If `create-github-releases` is set to `true`, this option will also always be `true`. |
|
|
|
|
| Outputs | Description |
|
|
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
| `published` | A "true" or "false" string value to indicate whether a publishing has happened or not |
|
|
| `published-packages` | A JSON array to present the published packages. The format is `[{"name": "@xx/xx", "version": "1.2.0"}, {"name": "@xx/xy", "version": "0.8.9"}]` |
|
|
|
|
<!-- api-end -->
|
|
|
|
[job-permissions]: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idpermissions
|
|
[workflow-triggers]: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
|