semantic-release / cli

:cl::round_pushpin: Setup automated semver compliant package publishing
MIT License
367 stars 45 forks source link

Basic Auth error when trying to attempt a dry-run #395

Closed codedbypaul closed 11 months ago

codedbypaul commented 11 months ago

So i used npx semantic-release-cli setup and used a GitHub Personal Access Token. But when I try npm run semantic-release I get the following error:

[16:13:30] [semantic-release] › ℹ  Running semantic-release version 22.0.10
[16:13:30] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
[16:13:30] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[16:13:30] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[16:13:30] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[16:13:30] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
[16:13:30] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
[16:13:30] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[16:13:30] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[16:13:30] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[16:13:30] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[16:13:30] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[16:13:30] [semantic-release] › ⚠  This run was not triggered in a known CI environment, running in dry-run mode.
Username for 'https://github.com': codedbypaul
Password for 'https://codedbypaul@github.com':
[16:13:41] [semantic-release] › ⚠  Run automated release from branch develop on repository https://github.com/codedbypaul/ccwc-ts.git in dry-run mode
Username for 'https://github.com': codedbypaul
Password for 'https://codedbypaul@github.com':
[16:13:46] [semantic-release] › ✘  The command "git push --dry-run --no-verify https://github.com/codedbypaul/ccwc-ts.git HEAD:develop" failed with the error message remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/codedbypaul/ccwc-ts.git/'.
[16:13:46] [semantic-release] › ⚠  Skip step "fail" of plugin "@semantic-release/github" in dry-run mode
[16:13:46] [semantic-release] › ✘  EGITNOPERMISSION Cannot push to the Git repository.
semantic-release cannot push the version tag to the branch develop on the remote Git repository with URL https://github.com/codedbypaul/ccwc-ts.git.

This can be caused by:

    * a misconfiguration of the repositoryUrl option
    * the repository being unavailable
    * or missing push permission for the user configured via the Git credentials on your CI environment

SemanticReleaseError: Cannot push to the Git repository.
    at default (file:///Users/<me>/Desktop/Work/personal/projects/coding-challenges/ccws/ccwc-ts/node_modules/semantic-release/lib/get-error.js:6:10)
    at run (file:///Users/<me>/Desktop/Work/personal/projects/coding-challenges/ccws/ccwc-ts/node_modules/semantic-release/index.js:101:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Module.default (file:///Users/<me>/Desktop/Work/personal/projects/coding-challenges/ccws/ccwc-ts/node_modules/semantic-release/index.js:275:22)
    at async default (file:///Users/<me>/Desktop/Work/personal/projects/coding-challenges/ccws/ccwc-ts/node_modules/semantic-release/cli.js:55:5) {
  code: 'EGITNOPERMISSION',
  details: '**semantic-release** cannot push the version tag to the branch `develop` on the remote Git repository with URL `https://github.com/codedbypaul/ccwc-ts.git`.\n' +
    '\n' +
    'This can be caused by:\n' +
    ' - a misconfiguration of the [repositoryUrl](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#repositoryurl) option\n' +
    ' - the repository being unavailable\n' +
    ' - or missing push permission for the user configured via the [Git credentials on your CI environment](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md#authentication)',
  semanticRelease: true
}%

It asks for my Github username and password twice as you can see, and then fails due to support for password authentication being removed. Is there a step I've missed somewhere?