mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-18 02:20:09 +00:00
fix(dependencies): check if repo is clean before committing
This commit is contained in:
parent
1d31ff6037
commit
0493eab8ce
1 changed files with 21 additions and 15 deletions
36
.github/workflows/dependencies/updater.py
vendored
36
.github/workflows/dependencies/updater.py
vendored
|
@ -390,21 +390,27 @@ class Git:
|
||||||
clean_env["GIT_CONFIG_GLOBAL"] = "/dev/null"
|
clean_env["GIT_CONFIG_GLOBAL"] = "/dev/null"
|
||||||
clean_env["GIT_CONFIG_NOSYSTEM"] = "1"
|
clean_env["GIT_CONFIG_NOSYSTEM"] = "1"
|
||||||
|
|
||||||
# Commit with settings above
|
# check if repo is clean (clean => no error, no commit)
|
||||||
CommandRunner.run_or_fail(
|
try:
|
||||||
[
|
CommandRunner.run_or_fail(
|
||||||
"git",
|
["git", "diff", "--exit-code"], stage="CheckRepoClean", env=clean_env
|
||||||
"-c",
|
)
|
||||||
f"user.name={user_name}",
|
except CommandRunner.Exception:
|
||||||
"-c",
|
# Commit with settings above
|
||||||
f"user.email={user_email}",
|
CommandRunner.run_or_fail(
|
||||||
"commit",
|
[
|
||||||
"-m",
|
"git",
|
||||||
f"feat({scope}): update to {version}",
|
"-c",
|
||||||
],
|
f"user.name={user_name}",
|
||||||
stage="CreateCommit",
|
"-c",
|
||||||
env=clean_env,
|
f"user.email={user_email}",
|
||||||
)
|
"commit",
|
||||||
|
"-m",
|
||||||
|
f"feat({scope}): update to {version}",
|
||||||
|
],
|
||||||
|
stage="CreateCommit",
|
||||||
|
env=clean_env,
|
||||||
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def push(branch: str):
|
def push(branch: str):
|
||||||
|
|
Loading…
Reference in a new issue