Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 12 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down