Skip to content

Commit

Permalink
fix: add warning message if go mod pre-commit hook fails (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
akocbek authored Sep 29, 2023
1 parent 02370c3 commit f8b19a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions module-assets/ci/terraformDocGoMod.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@ def set_go_mod(path, module_url):
if regex:
regex_result = regex.string.strip()
if regex_result.lower() != expected_line.lower():
print(
"current value: {}\nnew value : {}".format(
regex_result.lower(), expected_line.lower()
)
)
replace_module = True
break
if replace_module:
lines[index] = expected_line + "\n"
with open(path, "w") as writer:
writer.writelines(lines)
print(
"\nwarning: If repository name has changed, then update 'remote.origin.url' locally by running 'git remote set-url origin new_repo_url' or re-clone the repo using the new repo name."
)


# modify module url to internal or external repo
Expand Down

0 comments on commit f8b19a2

Please sign in to comment.