Skip to content

Commit

Permalink
force terminal to get colorized in gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Sep 16, 2024
1 parent 8e98b48 commit 22f72eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from ghapi.all import GhApi
from registry import WildsRegistry
from rich import print
from rich.console import Console
console = Console(force_terminal=True)

api = GhApi()
reg = WildsRegistry()
Expand All @@ -12,11 +14,11 @@
def check_for_main(repo):
repo_gh = api.repos.get("getwilds", repo["name"])
default = repo_gh['default_branch']
if "mains" != default:
print(f'[bold red]{repo["name"]}[/bold red] needs a main branch as default; instead got {default}')
if "main" != default:
console.print(f'[bold red]{repo["name"]}[/bold red] needs a main branch as default; instead got {default}')
# raise Exception(f'[bold red]{repo["name"]}[/bold red] needs a main branch as default; instead got {default}')
else:
print(f"[bold green]{repo["name"]}[/bold green] all good")
console.print(f"[bold green]{repo["name"]}[/bold green] all good")
# repo = Repository(".")
# if "mains" not in list(repo.branches.local):
# raise Exception(f'main branch not found for {repo}')
Expand Down

0 comments on commit 22f72eb

Please sign in to comment.