Skip to content

Commit cb11419

Browse files
authored
fix: relax github token + remote requirement on init (#577)
1 parent 68abcbc commit cb11419

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/codegen/cli/auth/session.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,16 @@ def _validate(self) -> None:
7676
rich.print(format_command("export CODEGEN_SECRETS__GITHUB_TOKEN=<your-token>"))
7777
rich.print("Or pass in as a parameter:")
7878
rich.print(format_command("codegen init --token <your-token>"))
79-
raise click.Abort()
8079

8180
if self.local_git.origin_remote is None:
82-
rich.print("\n[bold red]Error:[/bold red] No remote found for repository")
83-
rich.print("[white]Please add a remote to the repository.[/white]")
81+
rich.print("\n[bold yellow]Warning:[/bold yellow] No remote found for repository")
82+
rich.print("[white]To enable full functionality, please add a remote to the repository[/white]")
8483
rich.print("\n[dim]To add a remote to the repository:[/dim]")
8584
rich.print(format_command("git remote add origin <your-repo-url>"))
86-
raise click.Abort()
8785

8886
try:
89-
Github(login_or_token=git_token).get_repo(self.local_git.full_name)
87+
if git_token is not None:
88+
Github(login_or_token=git_token).get_repo(self.local_git.full_name)
9089
except BadCredentialsException:
9190
rich.print(format_command(f"\n[bold red]Error:[/bold red] Invalid GitHub token={git_token} for repo={self.local_git.full_name}"))
9291
rich.print("[white]Please provide a valid GitHub token for this repository.[/white]")

0 commit comments

Comments
 (0)