Commit aebfbbc
committed
Update the CHANGELOG entry using npm version hook
Update the CHANGELOG entry using the "version" lifecycle hook
which will execute after the `npm version` is completed.
> If preversion, version, or postversion are in the scripts property of the package.json, they will be executed as part of running npm version.
> The exact order of execution is as follows:
> 1. Check to make sure the git working directory is clean before we get started. Your scripts may add files to the commit in future steps. This step is skipped if the --force flag is set.
> 2. Run the preversion script. These scripts have access to the old version in package.json. A typical use would be running your full test suite before deploying. Any files you want added to the commit should be explicitly added using git add.
> 3. Bump version in package.json as requested (patch, minor, major, etc).
> 4. Run the version script. These scripts have access to the new version in package.json (so they can incorporate it into file headers in generated files for example). Again, scripts should explicitly add generated files to the commit using git add.
> 5. Commit and tag.
> 6. Run the postversion script. Use it to clean up the file system or automatically push the commit and/or tag.
https://docs.npmjs.com/cli/v11/commands/npm-version#description
Uses undocumented environment variables to get both the old and new
versions:
https://github.com/npm/cli/blob/c97b39b1e3436cd20a67ab5f4012a5f395c538b9/workspaces/libnpmversion/lib/version.js#L100-L1031 parent e64f0e1 commit aebfbbc
3 files changed
Lines changed: 19 additions & 18 deletions
File tree
- .github/workflows
- bin
- packages/govuk-frontend
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 67 | + | |
| 68 | + | |
84 | 69 | | |
85 | 70 | | |
86 | 71 | | |
87 | 72 | | |
88 | 73 | | |
89 | 74 | | |
90 | 75 | | |
91 | | - | |
| 76 | + | |
| 77 | + | |
92 | 78 | | |
93 | 79 | | |
94 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
0 commit comments