[!IMPORTANT] This is the development branch for
changesets/actionv2 compatible with Changesets v3. For the v1 code compatible with Changesets v2, check out themaintenance/v1branch.
This repo contains a collection of GitHub Actions for Changesets. Check out the Automating Changesets guide to learn how to use these actions to automate your workflow.
This action handles versioning and publishing of packages. It's the equivalent of setting up the changesets/action/select-mode, changesets/action/version, and changesets/action/publish actions in a workflow, but with the required permissions combined.
If using trusted publishing, it's recommended to set up the individual sub-actions instead to tighten publish permissions.
@changesets/cli installedcontents: write: to commit version changespull-requests: write: to create pull requestid-token: write: if using trusted publishing[!NOTE] In your repository settings, in
Actions > General, also ensure theAllow GitHub Actions to create and approve pull requestsoption is enabled
[!TIP] Check out the docs to learn how to set up the version and publish workflow.
[!IMPORTANT] To use a custom GitHub token, pass it explicitly through the
github-tokeninput:with: github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}Setting the
GITHUB_TOKENenvironment variable does not configure the action. This applies whether release changes are pushed using the GitHub API or the Git CLI.
| 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. |
publish-script | The command to use to build and publish packages |
version-script | The command to update version, edit CHANGELOG, read and delete changesets. Default to changeset version if not provided |
commit-message | The commit message. Default to Version Packages |
pr-title | The pull request title. Default to Version Packages |
pr-draft | Controls draft PR behavior. Use 'create' to create new version PRs as draft, or 'always' to also convert existing version PRs back to draft when updating them. |
pr-base-branch | Sets the base branch of the PR. Defaults to github.ref_name. |
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. |
push-with-git-cli | Whether to use the Git CLI instead of the GitHub API to push release commits and tags. Defaults to false. When using the GitHub API, commits and tags are signed using GitHub's GPG key and attributed to the user or app that owns the github-token. |
cwd | The working directory to execute Changesets in. Defaults to the root of the repository. |
| Outputs | Description |
|---|---|
published | A "true" or "false" string value to indicate whether a publishing is 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"}] |
has-changesets | A "true" or "false" string value about whether there were changesets. Useful if you want to create your own publishing functionality. |
pr-number | The pull request number that was created or updated |
(top 30 of 53)
TypeScript
99.5%
[!IMPORTANT] This is the development branch for
changesets/actionv2 compatible with Changesets v3. For the v1 code compatible with Changesets v2, check out themaintenance/v1branch.
This repo contains a collection of GitHub Actions for Changesets. Check out the Automating Changesets guide to learn how to use these actions to automate your workflow.
This action handles versioning and publishing of packages. It's the equivalent of setting up the changesets/action/select-mode, changesets/action/version, and changesets/action/publish actions in a workflow, but with the required permissions combined.
If using trusted publishing, it's recommended to set up the individual sub-actions instead to tighten publish permissions.
@changesets/cli installedcontents: write: to commit version changespull-requests: write: to create pull requestid-token: write: if using trusted publishing[!NOTE] In your repository settings, in
Actions > General, also ensure theAllow GitHub Actions to create and approve pull requestsoption is enabled
[!TIP] Check out the docs to learn how to set up the version and publish workflow.
[!IMPORTANT] To use a custom GitHub token, pass it explicitly through the
github-tokeninput:with: github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}Setting the
GITHUB_TOKENenvironment variable does not configure the action. This applies whether release changes are pushed using the GitHub API or the Git CLI.
| 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. |
publish-script | The command to use to build and publish packages |
version-script | The command to update version, edit CHANGELOG, read and delete changesets. Default to changeset version if not provided |
commit-message | The commit message. Default to Version Packages |
pr-title | The pull request title. Default to Version Packages |
pr-draft | Controls draft PR behavior. Use 'create' to create new version PRs as draft, or 'always' to also convert existing version PRs back to draft when updating them. |
pr-base-branch | Sets the base branch of the PR. Defaults to github.ref_name. |
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. |
push-with-git-cli | Whether to use the Git CLI instead of the GitHub API to push release commits and tags. Defaults to false. When using the GitHub API, commits and tags are signed using GitHub's GPG key and attributed to the user or app that owns the github-token. |
cwd | The working directory to execute Changesets in. Defaults to the root of the repository. |
| Outputs | Description |
|---|---|
published | A "true" or "false" string value to indicate whether a publishing is 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"}] |
has-changesets | A "true" or "false" string value about whether there were changesets. Useful if you want to create your own publishing functionality. |
pr-number | The pull request number that was created or updated |
(top 30 of 53)
TypeScript
99.5%