From c5659cf4bd219c684c43152f10d6ec321a9730e7 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Fri, 23 May 2025 12:24:01 +1000 Subject: [PATCH 1/2] Update README.md --- README.md | 50 ++++++++++++-------------------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 9657d24..9cd64d1 100644 --- a/README.md +++ b/README.md @@ -81,44 +81,17 @@ A `NPM_TOKEN` needs to be created and added to the repository to (publish packag ## Action workflow options -**`build_script` (optional)** - -The build script to run before publishing. - -**`comment_command` (optional, default `/snapit`)** - -The comment to write to trigger the creation of a snapshot. - -**`branch` (optional)** - -Push the changes to a branch instead of publishing to the NPM registry. - -**`custom_message_prefix` (optional)** - -Custom message to added to the beginning of the release GitHub comment. -By default a generic message is shown: "Test the snapshots by updating your package.json with the newly published versions:" - -**`custom_message_suffix` (optional)** - -Custom message to added to the end of the release GitHub comment. - -**`global_install` (optional)** - -If true, the generated GitHub comment will show the command to install your packages globally. -Otherwise, the default behaviour is to show a json example to update your local dependencies. - -**`github_comment_included_packages` (optional)** - -In workspaces where many packages are deployed, use this filter if you only want to include some of them in the release GitHub comment. -(To specify multiple packages, separate using commas) - -**`working_directory` (optional)** - -If specified, the action will run all commands for snapit in the specified directory. - -**`post_install_script` (optional)** - -If specified, will run a script after dependencies are installed. +| Option | Default | Description | +| ---------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `build_script` | - | The build script to run before publishing. | +| `comment_command` | `/snapit` | The comment to write to trigger the creation of a snapshot. | +| `branch` | - | Push the changes to a branch instead of publishing to the NPM registry. | +| `custom_message_prefix` | - | Custom message to add to the beginning of the release GitHub comment. Default: "Test the snapshots by updating your package.json with the newly published versions:" | +| `custom_message_suffix` | - | Custom message to add to the end of the release GitHub comment. | +| `global_install` | `false` | If true, the generated GitHub comment will show the command to install your packages globally. Otherwise, shows a JSON example to update local dependencies. | +| `github_comment_included_packages` | - | Filter to include specific packages in the release GitHub comment. Separate multiple packages with commas. | +| `working_directory` | - | If specified, the action will run all commands for snapit in the specified directory. | +| `post_install_script` | - | If specified, will run a script after dependencies are installed. | ## Contributing @@ -135,6 +108,7 @@ To contribute a change, bug fix or feature to snapit: **`v0.0.14`** +- Improved error logging - `build_script` is now optional - Adds optional `working_directory` to run snap it commands from - Adds optional `post_install` script From 3209d89a8ff7dedcd00f4bedef1599bed0d7f24d Mon Sep 17 00:00:00 2001 From: Ryan Wilson-Perkin Date: Thu, 17 Jul 2025 14:21:28 -0400 Subject: [PATCH 2/2] Support changeset-release/ branch with custom suffix We're working on adding support for custom changeset-release/ branch suffixes so that we can handle multi-library monorepos https://github.com/changesets/action/pull/513 --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 5b19f1e..a2634e9 100644 --- a/index.ts +++ b/index.ts @@ -103,10 +103,10 @@ try { ); // Because changeset entries are consumed and removed on the - // 'changeset-release/main' branch, we need to reset the files + // 'changeset-release/*' branch, we need to reset the files // so the following 'changeset version --snapshot' command will // regenerate the package version bumps with the snapshot releases - if (currentBranch.trim() === 'changeset-release/main') { + if (currentBranch.trim().startsWith('changeset-release/')) { await exec( 'git', ['checkout', 'origin/main', '--', '.changeset'],