mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-28 10:45:07 +00:00
A quick fix for git_ser ice
This commit is contained in:
parent
49950b1639
commit
ff03450f58
@ -153,15 +153,15 @@ class GitService:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def handle_web_hook(cls, webhook: dict) -> bool:
|
def handle_web_hook(cls, webhook: dict) -> bool:
|
||||||
cls.check_for_publish_configs()
|
cls.check_for_publish_configs()
|
||||||
|
|
||||||
if "repository" not in webhook or "clone_url" not in webhook["repository"]:
|
if "repository" not in webhook or "clone_url" not in webhook["repository"]:
|
||||||
raise InvalidGitWebhookBodyError(
|
raise InvalidGitWebhookBodyError(
|
||||||
f"Cannot find required keys of 'repository:clone_url' from webhook body: {webhook}"
|
f"Cannot find required keys of 'repository:clone_url' from webhook body: {webhook}"
|
||||||
)
|
)
|
||||||
|
|
||||||
config_clone_url = current_app.config["SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_CLONE_URL"]
|
|
||||||
repo = webhook["repository"]
|
repo = webhook["repository"]
|
||||||
valid_clone_urls = [repo["clone_url"], repo["git_url"], repo["ssh_url"]]
|
valid_clone_urls = [repo["clone_url"], repo["git_url"], repo["ssh_url"]]
|
||||||
|
bpmn_spec_absolute_dir = current_app.config["SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR"]
|
||||||
|
with FileSystemService.cd(bpmn_spec_absolute_dir):
|
||||||
|
config_clone_url = cls.run_shell_command_to_get_stdout(["git", "config", "--get", "remote.origin.url"])
|
||||||
if config_clone_url not in valid_clone_urls:
|
if config_clone_url not in valid_clone_urls:
|
||||||
raise GitCloneUrlMismatchError(
|
raise GitCloneUrlMismatchError(
|
||||||
f"Configured clone url does not match the repo URLs from webhook: {config_clone_url} =/="
|
f"Configured clone url does not match the repo URLs from webhook: {config_clone_url} =/="
|
||||||
|
Loading…
x
Reference in New Issue
Block a user