Add setting to disable posting of commit statuses
Useful for testing.
This commit is contained in:
parent
0a67e157e0
commit
bddc6bf88e
2 changed files with 4 additions and 0 deletions
|
|
@ -64,6 +64,8 @@ class GitHubStatusState(str, Enum):
|
|||
async def notify_status(
|
||||
repo: str, sha: str, state: GitHubStatusState, target_url: str | None
|
||||
) -> None:
|
||||
if settings.disable_commit_statuses:
|
||||
return
|
||||
# https://docs.github.com/en/rest/reference/repos#create-a-commit-status
|
||||
await _github_request(
|
||||
"POST",
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ class Settings(BaseSettings):
|
|||
base_url: str = "http://localhost:8000"
|
||||
# HTML fragment for second footer.
|
||||
additional_footer_html: str = ""
|
||||
# Disable posting of statuses to GitHub commits
|
||||
disable_commit_statuses: bool = False
|
||||
|
||||
def get_build_settings(self, repo: str, target_branch: str) -> list[BuildSettings]:
|
||||
for repo_settings in self.repos:
|
||||
|
|
|
|||
Loading…
Reference in a new issue