Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated package.json "repository" field fails when creating release #803

Open
tusbar opened this issue Mar 29, 2024 · 2 comments
Open

Outdated package.json "repository" field fails when creating release #803

tusbar opened this issue Mar 29, 2024 · 2 comments

Comments

@tusbar
Copy link

tusbar commented Mar 29, 2024

I’ve had this issue twice already, so posting here to share and potentially fix the issue in here, or maybe (most likely?) it’s an issue with the GitHub API.

If you rename a repository, and forget to update the repository field in package.json, this plugin fails when creating a release with the following error:

[9:38:17 AM] [semantic-release] › ℹ  Start step "publish" of plugin "@semantic-release/github"
[9:38:32 AM] [semantic-release] › ✘  Failed step "publish" of plugin "@semantic-release/github"
[9:38:32 AM] [semantic-release] › ✘  An error occurred while running semantic-release: RequestError [HttpError]: fetch failed
    at /home/runner/work/serverless-plugin-env-stage-config/serverless-plugin-env-stage-config/node_modules/.pnpm/@[email protected]/node_modules/@octokit/request/dist-node/index.js:136:11
    at async requestWithGraphqlErrorHandling (/home/runner/work/serverless-plugin-env-stage-config/serverless-plugin-env-stage-config/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@octokit/plugin-retry/dist-node/index.js:71:20)
    at async Job.doExecute (/home/runner/work/serverless-plugin-env-stage-config/serverless-plugin-env-stage-config/node_modules/.pnpm/[email protected]/node_modules/bottleneck/light.js:405:18) {
  status: 500,
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/bizon/serverless-plugin-stage-config/releases',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': '@semantic-release/github v9.0.4 octokit-core.js/5.0.0 Node.js/20.11.1 (linux; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"tag_name":"v1.3.7","target_commitish":"master","name":"v1.3.7","body":"## [1.3.7](https://github.com/bizon/serverless-plugin-stage-config/compare/v1.3.6...v1.3.7) (2024-03-29)\\n\\n\\n### Bug Fixes\\n\\n* re-release ([3a067ca](https://github.com/bizon/serverless-plugin-stage-config/commit/3a067ca38cc[60](https://github.com/bizon/serverless-plugin-env-stage-config/actions/runs/8479540859/job/23233712289#step:6:61)c8fa862cddc20a32b8673a79cd0))\\n\\n\\n\\n","prerelease":false}',
    request: {
      agent: undefined,
      hook: [Function: bound bound register],
      retryCount: 3,
      retries: 3,
      retryAfter: 16
    }
  },
  pluginName: '@semantic-release/github'
}

The package was renamed from serverless-plugin-stage-config to serverless-plugin-env-stage-config. The redirections are still active, but POSTing a new release fails with a 500 error.

@tusbar
Copy link
Author

tusbar commented Mar 29, 2024

Maybe there could be an extra step in verify that checks if the repository field is valid?

@gr2m
Copy link
Member

gr2m commented Mar 29, 2024

I would love that, I ran into this problem several times myself and saw countless others run into it as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants