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

🐛 Bug: Initialization in newly created repo: no git remotes found from gh label list --json name #722

Closed
3 tasks done
JoshuaKGoldberg opened this issue Aug 29, 2023 · 2 comments · Fixed by #723 or #725
Closed
3 tasks done
Assignees
Labels
status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :(

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

After running npx template-typescript-node-package --skip-github-api, you're suggested to run the npx template-typescript-node-package --mode initialize command in the new repo. That should pass.

Actual

First I get this error about no git remotes found:

Error: Failed initializing GitHub repository
    at withSpinner (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/shared/cli/spinners.js:16:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async initializeWithOptions (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/initialize/initializeWithOptions.js:39:5)
    at async run (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/initialize/index.js:11:7)
    at async runOrRestore (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/shared/runOrRestore.js:7:5)
    at async Object.initialize (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/initialize/index.js:9:10)
    at async bin (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/bin/index.js:47:10)
    at async file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/bin/index.js:4:20 {
  [cause]: Error: Command failed with exit code 1: gh label list --json name
  no git remotes found
      at makeError (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/execa/lib/error.js:60:11)
      at handlePromise (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/execa/index.js:124:26)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async initializeRepositoryLabels (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js:7:6)
      at async initializeGitHubRepository (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/steps/initializeGitHubRepository/index.js:6:3)
      at async file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/initialize/initializeWithOptions.js:40:7
      at async withSpinner (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/shared/cli/spinners.js:11:20)
      at async initializeWithOptions (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/initialize/initializeWithOptions.js:39:5)
      at async run (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/initialize/index.js:11:7)
      at async runOrRestore (file:///Users/josh/.npm/_npx/b39740db704b12a5/node_modules/template-typescript-node-package/lib/shared/runOrRestore.js:7:5) {
    shortMessage: 'Command failed with exit code 1: gh label list --json name',
    command: 'gh label list --json name',
    escapedCommand: 'gh label list --json name',
    exitCode: 1,
    signal: undefined,
    signalDescription: undefined,
    stdout: '',
    stderr: 'no git remotes found',
    cwd: '/Users/josh/repos/temp/testing-cta-6',
    failed: true,
    timedOut: false,
    isCanceled: false,
    killed: false
  }
}

Additional Info

No response

@JoshuaKGoldberg JoshuaKGoldberg added type: bug Something isn't working :( status: accepting prs Please, send a pull request to resolve this! labels Aug 29, 2023
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Aug 29, 2023
@JoshuaKGoldberg JoshuaKGoldberg added this to the Ready to Rename milestone Aug 29, 2023
JoshuaKGoldberg added a commit that referenced this issue Aug 29, 2023
…e creation (#723)

## PR Checklist

- [x] Addresses an existing open issue: fixes #722
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/template-typescript-node-package/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

Instead of `pnpm initialize`, adds a re-run suggestion that takes in the
parsed options and re-prints them in the CLI. It hardcodes
`skip-github-api` and `skip-install` to `false` because they're needed
for the new repo.
@github-actions
Copy link

🎉 This is included in version v1.29.11 🎉

The release is available on:

Cheers! 📦🚀

JoshuaKGoldberg added a commit that referenced this issue Aug 29, 2023
## PR Checklist

- [x] Addresses an existing open issue: fixes #722
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/template-typescript-node-package/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

In `initializeGitHubRepository`, if there isn't yet an `origin` remote
per `git remote`, adds one.
@github-actions
Copy link

🎉 This is included in version v1.29.12 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :(
Projects
None yet
1 participant