Skip to content

Commit

Permalink
Add more debugging to ensure_sha (#422)
Browse files Browse the repository at this point in the history
* add more debugging to ensure_sha

* lint
  • Loading branch information
blink1073 committed Oct 5, 2022
1 parent 4aa6943 commit 2d957e0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions jupyter_releaser/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,13 @@ def ensure_sha():
"""Ensure the sha of the remote branch matches the expected sha"""
current_sha = os.environ["RH_CURRENT_SHA"]
branch = os.environ["RH_BRANCH"]
log("Ensuring sha...")
remote_name = get_remote_name(False)
run(f"git fetch {remote_name} {branch}")
sha = run(f"git rev-parse {remote_name}/{branch}")
run("git remote -v", echo=True)
run(f"git fetch {remote_name} {branch}", echo=True)
sha = run(f"git rev-parse {remote_name}/{branch}", echo=True)
if sha != current_sha:
raise ValueError(f"{branch} is ahead of expected sha {current_sha}")
raise ValueError(f"{branch} current sha {sha} is not equal to expected sha {current_sha}")


def get_gh_object(dry_run=False, **kwargs):
Expand Down

0 comments on commit 2d957e0

Please sign in to comment.