Skip to content

Commit 17959a9

Browse files
authored
Fix ensure_sha (#427)
* fix ensure_sha and doc links * docs
1 parent a5fc054 commit 17959a9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ GitHub actions scripts are available to draft a changelog, draft a release, publ
3030
See the [action details documentation](https://jupyter-releaser.readthedocs.io/en/latest/background/theory.html#action-details) for more information.
3131

3232
The actions can be run on a [fork](https://jupyter-releaser.readthedocs.io/en/latest/how_to_guides/convert_repo_from_releaser.html#) of `jupyter_releaser` and target multiple
33-
repositories, or run as workflows on the [source repositories](https://jupyter-releaser.readthedocs.io/en/latest/how_to_guides/convert_repo_from_repo), using
34-
shared credentials.
33+
repositories, or run as workflows on the [source repositories](https://jupyter-releaser.readthedocs.io/en/latest/how_to_guides/convert_repo_from_repo), using shared credentials.

jupyter_releaser/actions/populate_release.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@
2929

3030
dry_run = os.environ.get("RH_DRY_RUN", "").lower() == "true"
3131

32-
if not dry_run:
33-
# Ensure the branch sha has not changed.
34-
ensure_sha()
35-
3632
if not os.environ.get("RH_RELEASE_URL"):
3733
raise RuntimeError("Cannot complete Draft Release, no draft GitHub release url found!")
3834

3935
run_action("jupyter-releaser prep-git")
36+
37+
if not dry_run:
38+
# Ensure the branch sha has not changed.
39+
ensure_sha()
40+
4041
run_action("jupyter-releaser bump-version")
4142
run_action("jupyter-releaser extract-changelog")
4243

jupyter_releaser/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def ensure_sha():
604604
run(f"git fetch {remote_name} {branch}", echo=True)
605605
sha = run(f"git rev-parse {remote_name}/{branch}", echo=True)
606606
if sha != current_sha:
607-
log(f"{branch} current sha {sha} is not equal to expected sha {current_sha}")
607+
raise RuntimeError(f"{branch} current sha {sha} is not equal to expected sha {current_sha}")
608608

609609

610610
def get_gh_object(dry_run=False, **kwargs):

0 commit comments

Comments
 (0)