@semantic-release/github 10.3.5 → 11.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.
package/README.md CHANGED
@@ -168,14 +168,14 @@ files.
168
168
 
169
169
  The message for the issue comments is generated with [Lodash template](https://lodash.com/docs#template). The following variables are available:
170
170
 
171
- | Parameter | Description |
172
- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
173
- | `branch` | `Object` with `name`, `type`, `channel`, `range` and `prerelease` properties of the branch from which the release is done. |
174
- | `lastRelease` | `Object` with `version`, `channel`, `gitTag` and `gitHead` of the last release. |
175
- | `nextRelease` | `Object` with `version`, `channel`, `gitTag`, `gitHead` and `notes` of the release being done. |
176
- | `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
177
- | `releases` | `Array` with a release `Object`s for each release published, with optional release data such as `name` and `url`. |
178
- | `issue` | A [GitHub API pull request object](https://developer.github.com/v3/search/#search-issues) for pull requests related to a commit, or an `Object` with the `number` property for issues resolved via [keywords](https://help.github.com/articles/closing-issues-using-keywords) |
171
+ | Parameter | Description |
172
+ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
173
+ | `branch` | `Object` with `name`, `type`, `channel`, `range` and `prerelease` properties of the branch from which the release is done. |
174
+ | `lastRelease` | `Object` with `version`, `channel`, `gitTag` and `gitHead` of the last release. |
175
+ | `nextRelease` | `Object` with `version`, `channel`, `gitTag`, `gitHead` and `notes` of the release being done. |
176
+ | `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
177
+ | `releases` | `Array` with a release `Object`s for each release published, with optional release data such as `name` and `url`. |
178
+ | `issue` | A [GitHub API pull request object](https://developer.github.com/v3/search/#search-issues) for pull requests related to a commit, or [GitHub API issue object](https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#get-an-issue) for issues resolved via [keywords](https://help.github.com/articles/closing-issues-using-keywords) |
179
179
 
180
180
  ##### successComment example
181
181
 
@@ -187,14 +187,14 @@ The `successComment` `This ${issue.pull_request ? 'pull request' : 'issue'} is i
187
187
 
188
188
  The message for the issue comments is generated with [Lodash template](https://lodash.com/docs#template). The following variables are available:
189
189
 
190
- | Parameter | Description |
191
- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
192
- | `branch` | `Object` with `name`, `type`, `channel`, `range` and `prerelease` properties of the branch from which the release is done. |
193
- | `lastRelease` | `Object` with `version`, `channel`, `gitTag` and `gitHead` of the last release. |
194
- | `nextRelease` | `Object` with `version`, `channel`, `gitTag`, `gitHead` and `notes` of the release being done. |
195
- | `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
196
- | `releases` | `Array` with a release `Object`s for each release published, with optional release data such as `name` and `url`. |
197
- | `issue` | A [GitHub API Pull Request object](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request) for pull requests related to a commit, or an `Object` with the `number` property for issues resolved via [keywords](https://help.github.com/articles/closing-issues-using-keywords) |
190
+ | Parameter | Description |
191
+ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
192
+ | `branch` | `Object` with `name`, `type`, `channel`, `range` and `prerelease` properties of the branch from which the release is done. |
193
+ | `lastRelease` | `Object` with `version`, `channel`, `gitTag` and `gitHead` of the last release. |
194
+ | `nextRelease` | `Object` with `version`, `channel`, `gitTag`, `gitHead` and `notes` of the release being done. |
195
+ | `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
196
+ | `releases` | `Array` with a release `Object`s for each release published, with optional release data such as `name` and `url`. |
197
+ | `issue` | A [GitHub API Pull Request object](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request) for pull requests related to a commit |
198
198
 
199
199
  ##### successCommentCondition example
200
200
 
@@ -202,7 +202,7 @@ The message for the issue comments is generated with [Lodash template](https://l
202
202
  - to only comment on issues: `"<% return !issue.pull_request; %>"`
203
203
  - to only comment on pull requests: `"<% return issue.pull_request; %>"`
204
204
  - to avoid comment on PRs or issues created by Bots: `"<% return issue.user.type !== 'Bot'; %>"`
205
- - you can use labels to filter issues: `"<% return issue.labels?.includes('semantic-release-relevant'); %>"`
205
+ - you can use labels to filter issues: `"<% return issue.labels?.some((label) => { return label.name === ('semantic-release-relevant'); }); %>"`
206
206
 
207
207
  > check the [GitHub API issue object](https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#get-an-issue) for properties which can be used for the filter
208
208
 
@@ -228,14 +228,14 @@ The `failComment` `This release from branch ${branch.name} had failed due to the
228
228
 
229
229
  The message for the issue content is generated with [Lodash template](https://lodash.com/docs#template). The following variables are available:
230
230
 
231
- | Parameter | Description |
232
- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
233
- | `branch` | `Object` with `name`, `type`, `channel`, `range` and `prerelease` properties of the branch from which the release is done. |
234
- | `lastRelease` | `Object` with `version`, `channel`, `gitTag` and `gitHead` of the last release. |
235
- | `nextRelease` | `Object` with `version`, `channel`, `gitTag`, `gitHead` and `notes` of the release being done. |
236
- | `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
237
- | `releases` | `Array` with a release `Object`s for each release published, with optional release data such as `name` and `url`. |
238
- | `issue` | A [GitHub API pull request object](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request) for pull requests related to a commit, or an `Object` with the `number` property for issues resolved via [keywords](https://help.github.com/articles/closing-issues-using-keywords) |
231
+ | Parameter | Description |
232
+ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
233
+ | `branch` | `Object` with `name`, `type`, `channel`, `range` and `prerelease` properties of the branch from which the release is done. |
234
+ | `lastRelease` | `Object` with `version`, `channel`, `gitTag` and `gitHead` of the last release. |
235
+ | `nextRelease` | `Object` with `version`, `channel`, `gitTag`, `gitHead` and `notes` of the release being done. |
236
+ | `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
237
+ | `releases` | `Array` with a release `Object`s for each release published, with optional release data such as `name` and `url`. |
238
+ | `issue` | A [GitHub API pull request object](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request) for pull requests related to a commit, or [GitHub API issue object](https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#get-an-issue) for issues resolved via [keywords](https://help.github.com/articles/closing-issues-using-keywords) |
239
239
 
240
240
  ##### failCommentCondition example
241
241
 
@@ -249,14 +249,14 @@ The message for the issue content is generated with [Lodash template](https://lo
249
249
 
250
250
  Each label name is generated with [Lodash template](https://lodash.com/docs#template). The following variables are available:
251
251
 
252
- | Parameter | Description |
253
- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
254
- | `branch` | `Object` with `name`, `type`, `channel`, `range` and `prerelease` properties of the branch from which the release is done. |
255
- | `lastRelease` | `Object` with `version`, `channel`, `gitTag` and `gitHead` of the last release. |
256
- | `nextRelease` | `Object` with `version`, `channel`, `gitTag`, `gitHead` and `notes` of the release being done. |
257
- | `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
258
- | `releases` | `Array` with a release `Object`s for each release published, with optional release data such as `name` and `url`. |
259
- | `issue` | A [GitHub API pull request object](https://developer.github.com/v3/search/#search-issues) for pull requests related to a commit, or an `Object` with the `number` property for issues resolved via [keywords](https://help.github.com/articles/closing-issues-using-keywords) |
252
+ | Parameter | Description |
253
+ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
254
+ | `branch` | `Object` with `name`, `type`, `channel`, `range` and `prerelease` properties of the branch from which the release is done. |
255
+ | `lastRelease` | `Object` with `version`, `channel`, `gitTag` and `gitHead` of the last release. |
256
+ | `nextRelease` | `Object` with `version`, `channel`, `gitTag`, `gitHead` and `notes` of the release being done. |
257
+ | `commits` | `Array` of commit `Object`s with `hash`, `subject`, `body` `message` and `author`. |
258
+ | `releases` | `Array` with a release `Object`s for each release published, with optional release data such as `name` and `url`. |
259
+ | `issue` | A [GitHub API pull request object](https://developer.github.com/v3/search/#search-issues) for pull requests related to a commit, or [GitHub API issue object](https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#get-an-issue) for issues resolved via [keywords](https://help.github.com/articles/closing-issues-using-keywords) |
260
260
 
261
261
  ##### releasedLabels example
262
262
 
package/lib/fail.js CHANGED
@@ -32,8 +32,7 @@ export default async function fail(pluginConfig, context, { Octokit }) {
32
32
 
33
33
  if (failComment === false || failTitle === false) {
34
34
  logger.log("Skip issue creation.");
35
- // TODO: use logger.warn() instead of logger.log()
36
- logger.log(
35
+ logger.warn(
37
36
  `DEPRECATION: 'false' for 'failComment' or 'failTitle' is deprecated and will be removed in a future major version. Use 'failCommentCondition' instead.`,
38
37
  );
39
38
  } else if (failCommentCondition === false) {
package/lib/success.js CHANGED
@@ -62,8 +62,7 @@ export default async function success(pluginConfig, context, { Octokit }) {
62
62
  logger.log("No commits found in release");
63
63
  }
64
64
  logger.log("Skip commenting on issues and pull requests.");
65
- // TODO: use logger.warn() instead of logger.log()
66
- logger.log(
65
+ logger.warn(
67
66
  `DEPRECATION: 'false' for 'successComment' is deprecated and will be removed in a future major version. Use 'successCommentCondition' instead.`,
68
67
  );
69
68
  } else if (successCommentCondition === false) {
@@ -387,6 +386,8 @@ const baseFields = `
387
386
  url
388
387
  name
389
388
  color
389
+ description
390
+ isDefault
390
391
  }
391
392
  }
392
393
  milestone {
@@ -522,7 +523,16 @@ function buildIssuesOrPRsFromResponseNode(responseNodes, type = "ISSUE") {
522
523
  number: node.number,
523
524
  title: node.title,
524
525
  body: node.body,
525
- labels: node.labels?.nodes.map((label) => label.name),
526
+ labels: node.labels?.nodes.map((label) => {
527
+ return {
528
+ id: label.id,
529
+ url: label.url,
530
+ name: label.name,
531
+ color: label.color,
532
+ description: label.description,
533
+ default: label.isDefault,
534
+ };
535
+ }),
526
536
  html_url: node.url,
527
537
  created_at: node.createdAt,
528
538
  updated_at: node.updatedAt,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semantic-release/github",
3
3
  "description": "semantic-release plugin to publish a GitHub release and comment on released Pull Requests/Issues",
4
- "version": "10.3.5",
4
+ "version": "11.0.0",
5
5
  "type": "module",
6
6
  "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)",
7
7
  "ava": {
@@ -101,7 +101,7 @@
101
101
  ]
102
102
  },
103
103
  "peerDependencies": {
104
- "semantic-release": ">=20.1.0"
104
+ "semantic-release": ">=24.1.0"
105
105
  },
106
106
  "publishConfig": {
107
107
  "access": "public",