autorel 2.6.18 → 2.6.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +8 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -89,7 +89,7 @@ When autorel runs, it follows this sequence:
89
89
  4. **Run pre-release tasks** - Executes `preRun` scripts (tests, builds, etc.) if configured
90
90
  5. **Create git tag** - Tags the current commit with the new version
91
91
  6. **Create GitHub release** - Creates a release on GitHub with changelog (unless `--skip-release`)
92
- 7. **Update package.json** - Updates version temporarily in memory (not committed to repo)
92
+ 7. **Update package.json** - Updates package.json "version" field locally (not an additional commit)
93
93
  8. **Publish to npm** - Publishes package if `--publish` is set
94
94
  9. **Restore package.json** - Immediately restores package.json to original version (always happens, even if publish fails)
95
95
  10. **Run post-release scripts** - Executes `run` scripts with `NEXT_VERSION` and `NEXT_TAG` environment variables
@@ -229,15 +229,17 @@ jobs:
229
229
 
230
230
  ### Using `--run` with the version in GitHub Actions
231
231
 
232
- **Only if you put `NEXT_VERSION` or `NEXT_TAG` in your `--run` command** (e.g. as an argument to your script), use a double dollar so the version is passed through. For example:
232
+ When passing `$NEXT_VERSION` or `$NEXT_TAG` in your `--run` command, wrap the `--run` argument in **single quotes** so the shell doesn't expand the variable before autorel has a chance to set it:
233
233
 
234
234
  ```yaml
235
- - run: npx autorel@^2 --publish --run "deploy-service $$NEXT_VERSION"
235
+ - run: npx autorel@^2 --publish --run 'deploy-service $NEXT_VERSION'
236
236
  ```
237
237
 
238
- In Actions the step `run:` is expanded by the runner *before* autorel runs, so a single `$` would be expanded when the variable is still unset. `$$` becomes a literal `$`, so the shell that runs your script gets `$NEXT_VERSION` after autorel has set it.
238
+ With single quotes, `$NEXT_VERSION` is passed as a literal string to autorel. Autorel sets the environment variable and then executes your command in a sub-shell where it resolves correctly.
239
239
 
240
- You can also use `.autorel.yaml` or a script (e.g. `--run "./blah.sh"`); they run in a shell where the version is already set, so `$NEXT_VERSION` / `$NEXT_TAG` work as usual. `NEXT_TAG` is also available (e.g. for Docker tags that use `v`).
240
+ > ⚠️ **Do not use double quotes** around the `--run` argument the shell would expand `$NEXT_VERSION` to an empty string before autorel runs.
241
+
242
+ You can also use `.autorel.yaml` or a wrapper script (e.g. `--run "./deploy.sh"`); they run in a shell where the version is already set, so `$NEXT_VERSION` / `$NEXT_TAG` work as usual.
241
243
 
242
244
  ## Authentication & Permissions
243
245
 
@@ -260,7 +262,7 @@ To publish packages to npm, you need authentication:
260
262
  ### About package.json Versions
261
263
 
262
264
  When using npm publishing, autorel:
263
- 1. Temporarily updates `package.json` version in memory
265
+ 1. Updates `package.json` version locally (not commited)
264
266
  2. Publishes to npm with that version
265
267
  3. **Immediately restores** `package.json` to the original version (even if publish fails)
266
268
  4. Then runs post-release scripts (`--run`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autorel",
3
- "version": "2.6.18",
3
+ "version": "2.6.20",
4
4
  "description": "Automate semantic releases based on conventional commits. Similar to semantic-release but much simpler.",
5
5
  "license": "MIT",
6
6
  "author": "Marc H. Weiner <mhweiner234@gmail.com> (https://mhweiner.com)",