github: Release fails when adding "release" labels. Error 422.

Hello,

I’m not sure which version introduced this issue, but I know it happens as far back as 5.2.1 for me (It happened on 5.2.5 and 5.2.6).

I’m seeing the following only when PRs are merged:

[14:14:30] [semantic-release] [@semantic-release/github] › ℹ  Added comment to issue #538: https://github.enterprise.com/ORG/plugin-cli/pull/538#issuecomment-518258
[14:14:33] [semantic-release] [@semantic-release/github] › ℹ  Added comment to issue #539: https://github.enterprise.com/ORG/plugin-cli/pull/539#issuecomment-518259
[14:14:36] [semantic-release] [@semantic-release/github] › ℹ  Added comment to issue #541: https://github.enterprise.com/ORG/plugin-cli/pull/541#issuecomment-518260
[14:15:06] [semantic-release] [@semantic-release/github] › ✖  Failed to add a comment to the issue #538.
[14:15:09] [semantic-release] [@semantic-release/github] › ✖  Failed to add a comment to the issue #539.
[14:15:12] [semantic-release] [@semantic-release/github] › ✖  Failed to add a comment to the issue #541.
  semantic-release:github found semantic-release issues: [] +42s
[14:15:12] [semantic-release] › ✖  Failed step "success" of plugin "@semantic-release/github"
[14:15:12] [semantic-release] › ✖  An error occurred while running semantic-release: { HttpError: Invalid request.

For 'links/2/schema', {"labels"=>["released"]} is not an array.
    at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
  name: 'HttpError',
  status: 422,
  headers: 
   { 'access-control-allow-origin': '*',
     'access-control-expose-headers': 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval',
     connection: 'close',
     'content-length': '209',
     'content-security-policy': 'default-src \'none\'',
     'content-type': 'application/json; charset=utf-8',
     date: 'Fri, 14 Dec 2018 14:15:06 GMT',
     server: 'GitHub.com',
     status: '422 Unprocessable Entity',
     'strict-transport-security': 'max-age=31536000; includeSubdomains',
     'x-accepted-oauth-scopes': '',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-github-enterprise-version': '2.12.22',
     'x-github-media-type': 'github.v3; format=json',
     'x-github-request-id': 'b067d086-6b6f-4824-92d1-c0791379a377',
     'x-oauth-scopes': 'admin:public_key, public_repo, repo:status',
     'x-runtime-rack': '0.023969',
     'x-xss-protection': '1; mode=block' },
  request: 
   { method: 'POST',
     url: 'https://github.enterprise.com/api/v3/repos/ORG/plugin-cli/issues/538/labels',
     headers: 
      { accept: 'application/vnd.github.v3+json',
        'user-agent': 'octokit.js/16.2.0 Node.js/8.14.0 (Linux 3.13; x64)',
        authorization: 'token [secure]',
        'content-type': 'application/json; charset=utf-8' },
     body: '{"labels":["released"]}',
     request: { validate: [Object] } },
  documentation_url: 'https://developer.github.com/enterprise/2.12/v3/issues/labels/#add-labels-to-an-issue',
  attemptNumber: 4,
  retriesLeft: 0,
  pluginName: '@semantic-release/github' }
[14:15:12] [semantic-release] › ✖  An error occurred while running semantic-release: { HttpError: Invalid request.

For 'links/2/schema', {"labels"=>["released"]} is not an array.
    at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
  name: 'HttpError',
  status: 422,
  headers: 
   { 'access-control-allow-origin': '*',
     'access-control-expose-headers': 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval',
     connection: 'close',
     'content-length': '209',
     'content-security-policy': 'default-src \'none\'',
     'content-type': 'application/json; charset=utf-8',
     date: 'Fri, 14 Dec 2018 14:15:09 GMT',
     server: 'GitHub.com',
     status: '422 Unprocessable Entity',
     'strict-transport-security': 'max-age=31536000; includeSubdomains',
     'x-accepted-oauth-scopes': '',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-github-enterprise-version': '2.12.22',
     'x-github-media-type': 'github.v3; format=json',
     'x-github-request-id': 'c63d49e8-b108-43ce-9a88-b616e1fa3281',
     'x-oauth-scopes': 'admin:public_key, public_repo, repo:status',
     'x-runtime-rack': '0.029809',
     'x-xss-protection': '1; mode=block' },
  request: 
   { method: 'POST',
     url: 'https://github.enterprise.com/api/v3/repos/ORG/plugin-cli/issues/539/labels',
     headers: 
      { accept: 'application/vnd.github.v3+json',
        'user-agent': 'octokit.js/16.2.0 Node.js/8.14.0 (Linux 3.13; x64)',
        authorization: 'token [secure]',
        'content-type': 'application/json; charset=utf-8' },
     body: '{"labels":["released"]}',
     request: { validate: [Object] } },
  documentation_url: 'https://developer.github.com/enterprise/2.12/v3/issues/labels/#add-labels-to-an-issue',
  attemptNumber: 4,
  retriesLeft: 0,
  pluginName: '@semantic-release/github' }
[14:15:12] [semantic-release] › ✖  An error occurred while running semantic-release: { HttpError: Invalid request.

For 'links/2/schema', {"labels"=>["released"]} is not an array.
    at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
  name: 'HttpError',
  status: 422,
  headers: 
   { 'access-control-allow-origin': '*',
     'access-control-expose-headers': 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval',
     connection: 'close',
     'content-length': '209',
     'content-security-policy': 'default-src \'none\'',
     'content-type': 'application/json; charset=utf-8',
     date: 'Fri, 14 Dec 2018 14:15:12 GMT',
     server: 'GitHub.com',
     status: '422 Unprocessable Entity',
     'strict-transport-security': 'max-age=31536000; includeSubdomains',
     'x-accepted-oauth-scopes': '',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-github-enterprise-version': '2.12.22',
     'x-github-media-type': 'github.v3; format=json',
     'x-github-request-id': 'bfcc035e-b3a3-4bbb-8ea7-c5207ade3b3d',
     'x-oauth-scopes': 'admin:public_key, public_repo, repo:status',
     'x-runtime-rack': '0.024596',
     'x-xss-protection': '1; mode=block' },
  request: 
   { method: 'POST',
     url: 'https://github.enterprise.com/api/v3/repos/ORG/plugin-cli/issues/541/labels',
     headers: 
      { accept: 'application/vnd.github.v3+json',
        'user-agent': 'octokit.js/16.2.0 Node.js/8.14.0 (Linux 3.13; x64)',
        authorization: 'token [secure]',
        'content-type': 'application/json; charset=utf-8' },
     body: '{"labels":["released"]}',
     request: { validate: [Object] } },
  documentation_url: 'https://developer.github.com/enterprise/2.12/v3/issues/labels/#add-labels-to-an-issue',
  attemptNumber: 4,
  retriesLeft: 0,
  pluginName: '@semantic-release/github' }
{ AggregateError: 
    HttpError: Invalid request.
    For 'links/2/schema', {"labels"=>["released"]} is not an array.
        at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
        at <anonymous>
    HttpError: Invalid request.
    For 'links/2/schema', {"labels"=>["released"]} is not an array.
        at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
        at <anonymous>
    HttpError: Invalid request.
    For 'links/2/schema', {"labels"=>["released"]} is not an array.
        at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
        at <anonymous>
    at /home/circleci/project/node_modules/semantic-release/lib/plugins/pipeline.js:53:11
    at <anonymous> name: 'AggregateError' }error Command failed with exit code 1.
    at <anonymous> name: 'AggregateError' }error Command failed with exit code 1.

My config looks like:

➜ node release.config.js
config : {"prepare":["@semantic-release/npm","@semantic-release/git"],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/npm",["@semantic-release/github",{"releasedLabels":false}]]}

Any help or direction on how to fix this would be wonderful. I’m not sure when it started, but it is making it hard to release continuously.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

I just added 5.2.7 to @latest

For now, what I have gone and done is the following in package.json and updated my yarn.lock

  "resolutions": {
    "semantic-release/@semantic-release/github": "5.2.1"
  },

Not a perfect solution, but it unblocks us until this stuff is figured out. It is interesting because even though I specified that version as a devDependency, semantic-release brings it’s own in which is a ^ semver and grabs the latest, which is breaking. Also interesting is that it doesn’t use the one I provide, it uses the one it brings in. So even though I thought that I had a pinned version, I really didn’t.