semantic-release 20.0.0-beta.3 → 20.0.0

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 (37) hide show
  1. package/README.md +4 -5
  2. package/bin/semantic-release.js +9 -9
  3. package/cli.js +31 -31
  4. package/docs/developer-guide/js-api.md +46 -37
  5. package/docs/developer-guide/plugin.md +97 -93
  6. package/docs/extending/plugins-list.md +8 -7
  7. package/docs/extending/shareable-configurations-list.md +2 -0
  8. package/docs/recipes/ci-configurations/README.md +1 -0
  9. package/docs/recipes/ci-configurations/github-actions.md +6 -3
  10. package/docs/recipes/ci-configurations/gitlab-ci.md +2 -3
  11. package/docs/recipes/git-hosted-services/README.md +1 -0
  12. package/docs/recipes/git-hosted-services/git-auth-ssh-keys.md +4 -1
  13. package/docs/recipes/release-workflow/README.md +1 -0
  14. package/docs/recipes/release-workflow/distribution-channels.md +1 -0
  15. package/docs/recipes/release-workflow/maintenance-releases.md +1 -0
  16. package/docs/recipes/release-workflow/pre-releases.md +1 -0
  17. package/docs/support/FAQ.md +25 -14
  18. package/docs/support/node-version.md +1 -1
  19. package/docs/support/troubleshooting.md +1 -0
  20. package/docs/usage/ci-configuration.md +4 -3
  21. package/docs/usage/configuration.md +8 -2
  22. package/docs/usage/plugins.md +11 -5
  23. package/docs/usage/workflow-configuration.md +29 -17
  24. package/index.js +75 -72
  25. package/lib/get-commits.js +15 -9
  26. package/lib/get-config.js +38 -38
  27. package/lib/get-error.js +4 -4
  28. package/lib/get-git-auth-url.js +32 -32
  29. package/lib/get-last-release.js +8 -8
  30. package/lib/get-logger.js +10 -10
  31. package/lib/get-next-version.js +11 -11
  32. package/lib/get-release-to-add.js +17 -17
  33. package/lib/git.js +41 -41
  34. package/lib/hide-sensitive.js +6 -6
  35. package/lib/utils.js +12 -12
  36. package/lib/verify.js +14 -14
  37. package/package.json +6 -16
package/README.md CHANGED
@@ -56,10 +56,10 @@ Tools such as [commitizen](https://github.com/commitizen/cz-cli) or [commitlint]
56
56
 
57
57
  The table below shows which commit message gets you which release type when `semantic-release` runs (using the default configuration):
58
58
 
59
- | Commit message | Release type |
60
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
61
- | `fix(pencil): stop graphite breaking when too much pressure applied` | ~~Patch~~ Fix Release |
62
- | `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
59
+ | Commit message | Release type |
60
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
61
+ | `fix(pencil): stop graphite breaking when too much pressure applied` | ~~Patch~~ Fix Release |
62
+ | `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
63
63
  | `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release <br /> (Note that the `BREAKING CHANGE: ` token must be in the footer of the commit) |
64
64
 
65
65
  ### Automation with CI
@@ -145,7 +145,6 @@ Let people know that your package is published using **semantic-release** and wh
145
145
 
146
146
  ```md
147
147
  [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
148
-
149
148
  ```
150
149
 
151
150
  ## Team
@@ -2,17 +2,17 @@
2
2
 
3
3
  /* eslint-disable no-var */
4
4
 
5
- import semver from 'semver';
6
- import { execa } from 'execa';
7
- import findVersions from 'find-versions';
8
- import cli from '../cli.js';
9
- import {createRequire} from 'node:module';
5
+ import semver from "semver";
6
+ import { execa } from "execa";
7
+ import findVersions from "find-versions";
8
+ import cli from "../cli.js";
9
+ import { createRequire } from "node:module";
10
10
 
11
11
  const require = createRequire(import.meta.url);
12
- const { engines } = require('../package.json');
12
+ const { engines } = require("../package.json");
13
13
  const { satisfies, lt } = semver;
14
14
 
15
- const MIN_GIT_VERSION = '2.7.1';
15
+ const MIN_GIT_VERSION = "2.7.1";
16
16
 
17
17
  if (!satisfies(process.version, engines.node)) {
18
18
  console.error(
@@ -23,8 +23,8 @@ See https://github.com/semantic-release/semantic-release/blob/master/docs/suppor
23
23
  process.exit(1);
24
24
  }
25
25
 
26
- execa('git', ['--version'])
27
- .then(({stdout}) => {
26
+ execa("git", ["--version"])
27
+ .then(({ stdout }) => {
28
28
  const gitVersion = findVersions(stdout)[0];
29
29
  if (lt(gitVersion, MIN_GIT_VERSION)) {
30
30
  console.error(`[semantic-release]: Git version ${MIN_GIT_VERSION} is required. Found ${gitVersion}.`);
package/cli.js CHANGED
@@ -1,47 +1,47 @@
1
- import util from 'node:util';
2
- import yargs from 'yargs';
3
- import {hideBin} from 'yargs/helpers';
4
- import hideSensitive from './lib/hide-sensitive.js';
1
+ import util from "node:util";
2
+ import yargs from "yargs";
3
+ import { hideBin } from "yargs/helpers";
4
+ import hideSensitive from "./lib/hide-sensitive.js";
5
5
 
6
6
  const stringList = {
7
- type: 'string',
7
+ type: "string",
8
8
  array: true,
9
9
  coerce: (values) =>
10
- values.length === 1 && values[0].trim() === 'false'
10
+ values.length === 1 && values[0].trim() === "false"
11
11
  ? []
12
- : values.reduce((values, value) => values.concat(value.split(',').map((value) => value.trim())), []),
12
+ : values.reduce((values, value) => values.concat(value.split(",").map((value) => value.trim())), []),
13
13
  };
14
14
 
15
15
  export default async () => {
16
16
  const cli = yargs(hideBin(process.argv))
17
- .command('$0', 'Run automated package publishing', (yargs) => {
17
+ .command("$0", "Run automated package publishing", (yargs) => {
18
18
  yargs.demandCommand(0, 0).usage(`Run automated package publishing
19
19
 
20
20
  Usage:
21
21
  semantic-release [options] [plugins]`);
22
22
  })
23
- .option('b', {alias: 'branches', describe: 'Git branches to release from', ...stringList, group: 'Options'})
24
- .option('r', {alias: 'repository-url', describe: 'Git repository URL', type: 'string', group: 'Options'})
25
- .option('t', {alias: 'tag-format', describe: 'Git tag format', type: 'string', group: 'Options'})
26
- .option('p', {alias: 'plugins', describe: 'Plugins', ...stringList, group: 'Options'})
27
- .option('e', {alias: 'extends', describe: 'Shareable configurations', ...stringList, group: 'Options'})
28
- .option('ci', {describe: 'Toggle CI verifications', type: 'boolean', group: 'Options'})
29
- .option('verify-conditions', {...stringList, group: 'Plugins'})
30
- .option('analyze-commits', {type: 'string', group: 'Plugins'})
31
- .option('verify-release', {...stringList, group: 'Plugins'})
32
- .option('generate-notes', {...stringList, group: 'Plugins'})
33
- .option('prepare', {...stringList, group: 'Plugins'})
34
- .option('publish', {...stringList, group: 'Plugins'})
35
- .option('success', {...stringList, group: 'Plugins'})
36
- .option('fail', {...stringList, group: 'Plugins'})
37
- .option('debug', {describe: 'Output debugging information', type: 'boolean', group: 'Options'})
38
- .option('d', {alias: 'dry-run', describe: 'Skip publishing', type: 'boolean', group: 'Options'})
39
- .option('h', {alias: 'help', group: 'Options'})
23
+ .option("b", { alias: "branches", describe: "Git branches to release from", ...stringList, group: "Options" })
24
+ .option("r", { alias: "repository-url", describe: "Git repository URL", type: "string", group: "Options" })
25
+ .option("t", { alias: "tag-format", describe: "Git tag format", type: "string", group: "Options" })
26
+ .option("p", { alias: "plugins", describe: "Plugins", ...stringList, group: "Options" })
27
+ .option("e", { alias: "extends", describe: "Shareable configurations", ...stringList, group: "Options" })
28
+ .option("ci", { describe: "Toggle CI verifications", type: "boolean", group: "Options" })
29
+ .option("verify-conditions", { ...stringList, group: "Plugins" })
30
+ .option("analyze-commits", { type: "string", group: "Plugins" })
31
+ .option("verify-release", { ...stringList, group: "Plugins" })
32
+ .option("generate-notes", { ...stringList, group: "Plugins" })
33
+ .option("prepare", { ...stringList, group: "Plugins" })
34
+ .option("publish", { ...stringList, group: "Plugins" })
35
+ .option("success", { ...stringList, group: "Plugins" })
36
+ .option("fail", { ...stringList, group: "Plugins" })
37
+ .option("debug", { describe: "Output debugging information", type: "boolean", group: "Options" })
38
+ .option("d", { alias: "dry-run", describe: "Skip publishing", type: "boolean", group: "Options" })
39
+ .option("h", { alias: "help", group: "Options" })
40
40
  .strict(false)
41
41
  .exitProcess(false);
42
42
 
43
43
  try {
44
- const {help, version, ...options} = cli.parse(process.argv.slice(2));
44
+ const { help, version, ...options } = cli.parse(process.argv.slice(2));
45
45
 
46
46
  if (Boolean(help) || Boolean(version)) {
47
47
  return 0;
@@ -49,16 +49,16 @@ Usage:
49
49
 
50
50
  if (options.debug) {
51
51
  // Debug must be enabled before other requires in order to work
52
- (await import('debug')).default.enable('semantic-release:*');
52
+ (await import("debug")).default.enable("semantic-release:*");
53
53
  }
54
54
 
55
- await (await import('./index.js')).default(options);
55
+ await (await import("./index.js")).default(options);
56
56
  return 0;
57
57
  } catch (error) {
58
- if (error.name !== 'YError') {
59
- process.stderr.write(hideSensitive(process.env)(util.inspect(error, {colors: true})));
58
+ if (error.name !== "YError") {
59
+ process.stderr.write(hideSensitive(process.env)(util.inspect(error, { colors: true })));
60
60
  }
61
61
 
62
62
  return 1;
63
63
  }
64
- }
64
+ };
@@ -3,43 +3,48 @@
3
3
  ## Usage
4
4
 
5
5
  ```js
6
- const semanticRelease = require('semantic-release');
7
- const {WritableStreamBuffer} = require('stream-buffers');
6
+ const semanticRelease = require("semantic-release");
7
+ const { WritableStreamBuffer } = require("stream-buffers");
8
8
 
9
9
  const stdoutBuffer = WritableStreamBuffer();
10
10
  const stderrBuffer = WritableStreamBuffer();
11
11
 
12
12
  try {
13
- const result = await semanticRelease({
14
- // Core options
15
- branches: [
16
- '+([0-9])?(.{+([0-9]),x}).x',
17
- 'master',
18
- 'next',
19
- 'next-major',
20
- {name: 'beta', prerelease: true},
21
- {name: 'alpha', prerelease: true}
22
- ],
23
- repositoryUrl: 'https://github.com/me/my-package.git',
24
- // Shareable config
25
- extends: 'my-shareable-config',
26
- // Plugin options
27
- githubUrl: 'https://my-ghe.com',
28
- githubApiPathPrefix: '/api-prefix'
29
- }, {
30
- // Run semantic-release from `/path/to/git/repo/root` without having to change local process `cwd` with `process.chdir()`
31
- cwd: '/path/to/git/repo/root',
32
- // Pass the variable `MY_ENV_VAR` to semantic-release without having to modify the local `process.env`
33
- env: {...process.env, MY_ENV_VAR: 'MY_ENV_VAR_VALUE'},
34
- // Store stdout and stderr to use later instead of writing to `process.stdout` and `process.stderr`
35
- stdout: stdoutBuffer,
36
- stderr: stderrBuffer
37
- });
13
+ const result = await semanticRelease(
14
+ {
15
+ // Core options
16
+ branches: [
17
+ "+([0-9])?(.{+([0-9]),x}).x",
18
+ "master",
19
+ "next",
20
+ "next-major",
21
+ { name: "beta", prerelease: true },
22
+ { name: "alpha", prerelease: true },
23
+ ],
24
+ repositoryUrl: "https://github.com/me/my-package.git",
25
+ // Shareable config
26
+ extends: "my-shareable-config",
27
+ // Plugin options
28
+ githubUrl: "https://my-ghe.com",
29
+ githubApiPathPrefix: "/api-prefix",
30
+ },
31
+ {
32
+ // Run semantic-release from `/path/to/git/repo/root` without having to change local process `cwd` with `process.chdir()`
33
+ cwd: "/path/to/git/repo/root",
34
+ // Pass the variable `MY_ENV_VAR` to semantic-release without having to modify the local `process.env`
35
+ env: { ...process.env, MY_ENV_VAR: "MY_ENV_VAR_VALUE" },
36
+ // Store stdout and stderr to use later instead of writing to `process.stdout` and `process.stderr`
37
+ stdout: stdoutBuffer,
38
+ stderr: stderrBuffer,
39
+ }
40
+ );
38
41
 
39
42
  if (result) {
40
- const {lastRelease, commits, nextRelease, releases} = result;
43
+ const { lastRelease, commits, nextRelease, releases } = result;
41
44
 
42
- console.log(`Published ${nextRelease.type} release version ${nextRelease.version} containing ${commits.length} commits.`);
45
+ console.log(
46
+ `Published ${nextRelease.type} release version ${nextRelease.version} containing ${commits.length} commits.`
47
+ );
43
48
 
44
49
  if (lastRelease.version) {
45
50
  console.log(`The last release was "${lastRelease.version}".`);
@@ -49,14 +54,14 @@ try {
49
54
  console.log(`The release was published with plugin "${release.pluginName}".`);
50
55
  }
51
56
  } else {
52
- console.log('No release published.');
57
+ console.log("No release published.");
53
58
  }
54
59
 
55
60
  // Get stdout and stderr content
56
- const logs = stdoutBuffer.getContentsAsString('utf8');
57
- const errors = stderrBuffer.getContentsAsString('utf8');
61
+ const logs = stdoutBuffer.getContentsAsString("utf8");
62
+ const errors = stderrBuffer.getContentsAsString("utf8");
58
63
  } catch (err) {
59
- console.error('The automated release failed with %O', err)
64
+ console.error("The automated release failed with %O", err);
60
65
  }
61
66
  ```
62
67
 
@@ -131,7 +136,7 @@ Type: `Object`
131
136
  Information related to the last release found:
132
137
 
133
138
  | Name | Type | Description |
134
- |---------|----------|-------------------------------------------------------------------------------------------------------------------------------------|
139
+ | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
135
140
  | version | `String` | The version of the last release. |
136
141
  | gitHead | `String` | The sha of the last commit being part of the last release. |
137
142
  | gitTag | `String` | The [Git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) associated with the last release. |
@@ -140,6 +145,7 @@ Information related to the last release found:
140
145
  **Notes**: If no previous release is found, `lastRelease` will be an empty `Object`.
141
146
 
142
147
  Example:
148
+
143
149
  ```js
144
150
  {
145
151
  gitHead: 'da39a3ee5e6b4b0d3255bfef95601890afd80709',
@@ -157,7 +163,7 @@ The list of commit included in the new release.<br>
157
163
  Each commit object has the following properties:
158
164
 
159
165
  | Name | Type | Description |
160
- |-----------------|----------|-------------------------------------------------|
166
+ | --------------- | -------- | ----------------------------------------------- |
161
167
  | commit | `Object` | The commit abbreviated and full hash. |
162
168
  | commit.long | `String` | The commit hash. |
163
169
  | commit.short | `String` | The commit abbreviated hash. |
@@ -179,6 +185,7 @@ Each commit object has the following properties:
179
185
  | committerDate | `String` | The committer date. |
180
186
 
181
187
  Example:
188
+
182
189
  ```js
183
190
  [
184
191
  {
@@ -216,7 +223,7 @@ Type: `Object`
216
223
  Information related to the newly published release:
217
224
 
218
225
  | Name | Type | Description |
219
- |---------|----------|-------------------------------------------------------------------------------------------------------------------------------|
226
+ | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
220
227
  | type | `String` | The [semver](https://semver.org) type of the release (`patch`, `minor` or `major`). |
221
228
  | version | `String` | The version of the new release. |
222
229
  | gitHead | `String` | The sha of the last commit being part of the new release. |
@@ -225,6 +232,7 @@ Information related to the newly published release:
225
232
  | channel | `String` | The distribution channel on which the next release will be made available (`undefined` for the default distribution channel). |
226
233
 
227
234
  Example:
235
+
228
236
  ```js
229
237
  {
230
238
  type: 'minor',
@@ -244,7 +252,7 @@ The list of releases published or made available to a distribution channel.<br>
244
252
  Each release object has the following properties:
245
253
 
246
254
  | Name | Type | Description |
247
- |------------|----------|----------------------------------------------------------------------------------------------------------------|
255
+ | ---------- | -------- | -------------------------------------------------------------------------------------------------------------- |
248
256
  | name | `String` | **Optional.** The release name, only if set by the corresponding `publish` plugin. |
249
257
  | url | `String` | **Optional.** The release URL, only if set by the corresponding `publish` plugin. |
250
258
  | type | `String` | The [semver](https://semver.org) type of the release (`patch`, `minor` or `major`). |
@@ -256,6 +264,7 @@ Each release object has the following properties:
256
264
  | channel | `String` | The distribution channel on which the release is available (`undefined` for the default distribution channel). |
257
265
 
258
266
  Example:
267
+
259
268
  ```js
260
269
  [
261
270
  {
@@ -34,7 +34,7 @@ We recommend you setup a linting system to ensure good javascript practices are
34
34
  In your `index.js` file, you can start by writing the following code
35
35
 
36
36
  ```javascript
37
- const verify = require('./src/verify');
37
+ const verify = require("./src/verify");
38
38
 
39
39
  let verified;
40
40
 
@@ -54,7 +54,7 @@ module.exports = { verifyConditions };
54
54
  Then, in your `src` folder, create a file called `verify.js` and add the following
55
55
 
56
56
  ```javascript
57
- const AggregateError = require('aggregate-error');
57
+ const AggregateError = require("aggregate-error");
58
58
 
59
59
  /**
60
60
  * A method to verify that the user has given us a slack webhook url to post to
@@ -80,10 +80,10 @@ Let's say we want to verify that an `option` is passed. An `option` is a configu
80
80
 
81
81
  ```js
82
82
  {
83
- prepare: {
84
- path: "@semantic-release/my-special-plugin"
85
- message: "My cool release message"
86
- }
83
+ prepare: {
84
+ path: "@semantic-release/my-special-plugin";
85
+ message: "My cool release message";
86
+ }
87
87
  }
88
88
  ```
89
89
 
@@ -93,7 +93,7 @@ This `message` option will be passed to the `pluginConfig` object mentioned earl
93
93
  const { message } = pluginConfig;
94
94
 
95
95
  if (message.length) {
96
- //...
96
+ //...
97
97
  }
98
98
  ```
99
99
 
@@ -101,103 +101,104 @@ if (message.length) {
101
101
 
102
102
  ### Common context keys
103
103
 
104
- * `stdout`
105
- * `stderr`
106
- * `logger`
104
+ - `stdout`
105
+ - `stderr`
106
+ - `logger`
107
107
 
108
108
  ### Context object keys by lifecycle
109
109
 
110
110
  #### verifyConditions
111
111
 
112
112
  Initially the context object contains the following keys (`verifyConditions` lifecycle):
113
- * `cwd`
114
- * Current working directory
115
- * `env`
116
- * Environment variables
117
- * `envCi`
118
- * Information about CI environment
119
- * Contains (at least) the following keys:
120
- * `isCi`
121
- * Boolean, true if the environment is a CI environment
122
- * `commit`
123
- * Commit hash
124
- * `branch`
125
- * Current branch
126
- * `options`
127
- * Options passed to `semantic-release` via CLI, configuration files etc.
128
- * `branch`
129
- * Information on the current branch
130
- * Object keys:
131
- * `channel`
132
- * `tags`
133
- * `type`
134
- * `name`
135
- * `range`
136
- * `accept`
137
- * `main`
138
- * `branches`
139
- * Information on branches
140
- * List of branch objects (see above)
113
+
114
+ - `cwd`
115
+ - Current working directory
116
+ - `env`
117
+ - Environment variables
118
+ - `envCi`
119
+ - Information about CI environment
120
+ - Contains (at least) the following keys:
121
+ - `isCi`
122
+ - Boolean, true if the environment is a CI environment
123
+ - `commit`
124
+ - Commit hash
125
+ - `branch`
126
+ - Current branch
127
+ - `options`
128
+ - Options passed to `semantic-release` via CLI, configuration files etc.
129
+ - `branch`
130
+ - Information on the current branch
131
+ - Object keys:
132
+ - `channel`
133
+ - `tags`
134
+ - `type`
135
+ - `name`
136
+ - `range`
137
+ - `accept`
138
+ - `main`
139
+ - `branches`
140
+ - Information on branches
141
+ - List of branch objects (see above)
141
142
 
142
143
  #### analyzeCommits
143
144
 
144
145
  Compared to the verifyConditions, `analyzeCommits` lifecycle context has keys
145
146
 
146
- * `commits` (List)
147
- * List of commits taken into account when determining the new version.
148
- * Keys:
149
- * `commit` (Object)
150
- * Keys:
151
- * `long` (String, Commit hash)
152
- * `short` (String, Commit hash)
153
- * `tree` (Object)
154
- * Keys:
155
- * `long` (String, Commit hash)
156
- * `short` (String, Commit hash)
157
- * `author` (Object)
158
- * Keys:
159
- * `name` (String)
160
- * `email` (String)
161
- * `date` (String, ISO 8601 timestamp)
162
- * `committer` (Object)
163
- * Keys:
164
- * `name` (String)
165
- * `email` (String)
166
- * `date` (String, ISO 8601 timestamp)
167
- * `subject` (String, Commit message subject)
168
- * `body` (String, Commit message body)
169
- * `hash` (String, Commit hash)
170
- * `committerDate` (String, ISO 8601 timestamp)
171
- * `message` (String)
172
- * `gitTags` (String, List of git tags)
173
- * `releases` (List)
174
- * `lastRelease` (Object)
175
- * Keys
176
- * `version` (String)
177
- * `gitTag` (String)
178
- * `channels` (List)
179
- * `gitHead` (String, Commit hash)
180
- * `name` (String)
147
+ - `commits` (List)
148
+ - List of commits taken into account when determining the new version.
149
+ - Keys:
150
+ - `commit` (Object)
151
+ - Keys:
152
+ - `long` (String, Commit hash)
153
+ - `short` (String, Commit hash)
154
+ - `tree` (Object)
155
+ - Keys:
156
+ - `long` (String, Commit hash)
157
+ - `short` (String, Commit hash)
158
+ - `author` (Object)
159
+ - Keys:
160
+ - `name` (String)
161
+ - `email` (String)
162
+ - `date` (String, ISO 8601 timestamp)
163
+ - `committer` (Object)
164
+ - Keys:
165
+ - `name` (String)
166
+ - `email` (String)
167
+ - `date` (String, ISO 8601 timestamp)
168
+ - `subject` (String, Commit message subject)
169
+ - `body` (String, Commit message body)
170
+ - `hash` (String, Commit hash)
171
+ - `committerDate` (String, ISO 8601 timestamp)
172
+ - `message` (String)
173
+ - `gitTags` (String, List of git tags)
174
+ - `releases` (List)
175
+ - `lastRelease` (Object)
176
+ - Keys
177
+ - `version` (String)
178
+ - `gitTag` (String)
179
+ - `channels` (List)
180
+ - `gitHead` (String, Commit hash)
181
+ - `name` (String)
181
182
 
182
183
  #### verifyRelease
183
184
 
184
185
  Additional keys:
185
186
 
186
- * `nextRelease` (Object)
187
- * `type` (String)
188
- * `channel` (String)
189
- * `gitHead` (String, Git hash)
190
- * `version` (String, version without `v`)
191
- * `gitTag` (String, version with `v`)
192
- * `name` (String)
193
-
187
+ - `nextRelease` (Object)
188
+ - `type` (String)
189
+ - `channel` (String)
190
+ - `gitHead` (String, Git hash)
191
+ - `version` (String, version without `v`)
192
+ - `gitTag` (String, version with `v`)
193
+ - `name` (String)
194
+
194
195
  #### generateNotes
195
196
 
196
197
  No new content in the context.
197
198
 
198
199
  #### addChannel
199
200
 
200
- *This is run only if there are releases that have been merged from a higher branch but not added on the channel of the current branch.*
201
+ _This is run only if there are releases that have been merged from a higher branch but not added on the channel of the current branch._
201
202
 
202
203
  Context content is similar to lifecycle `verifyRelease`.
203
204
 
@@ -215,8 +216,8 @@ Lifecycles `success` and `fail` are mutually exclusive, only one of them will be
215
216
 
216
217
  Additional keys:
217
218
 
218
- * `releases`
219
- * Populated by `publish` lifecycle
219
+ - `releases`
220
+ - Populated by `publish` lifecycle
220
221
 
221
222
  #### fail
222
223
 
@@ -224,7 +225,7 @@ Lifecycles `success` and `fail` are mutually exclusive, only one of them will be
224
225
 
225
226
  Additional keys:
226
227
 
227
- * `errors`
228
+ - `errors`
228
229
 
229
230
  ### Supporting Environment Variables
230
231
 
@@ -237,13 +238,15 @@ if (env.GITHUB_TOKEN) {
237
238
  //...
238
239
  }
239
240
  ```
241
+
240
242
  ## Logger
243
+
241
244
  Use `context.logger` to provide debug logging in the plugin.
242
245
 
243
246
  ```js
244
247
  const { logger } = context;
245
248
 
246
- logger.log('Some message from plugin.').
249
+ logger.log('Some message from plugin.').
247
250
  ```
248
251
 
249
252
  The above usage yields the following where `PLUGIN_PACKAGE_NAME` is automatically inferred.
@@ -269,12 +272,13 @@ Knowledge that might be useful for plugin developers.
269
272
  While it may be trivial that multiple analyzeCommits (or any lifecycle plugins) can be defined, it is not that self-evident that the plugins executed AFTER the first one (for example, the default one: `commit-analyzer`) can change the result. This way it is possible to create more advanced rules or situations, e.g. if none of the commits would result in new release, then a default can be defined.
270
273
 
271
274
  The commit must be a known release type, for example the commit-analyzer has the following default types:
272
- * major
273
- * premajor
274
- * minor
275
- * preminor
276
- * patch
277
- * prepatch
278
- * prerelease
275
+
276
+ - major
277
+ - premajor
278
+ - minor
279
+ - preminor
280
+ - patch
281
+ - prepatch
282
+ - prerelease
279
283
 
280
284
  If the analyzeCommits-lifecycle plugin does not return anything, then the earlier result is used, but if it returns a supported string value, then that overrides the previous result.