Skip to content

Commit

Permalink
Fix ensure_sha (jupyter-server#427)
Browse files Browse the repository at this point in the history
* fix ensure_sha and doc links

* docs
  • Loading branch information
blink1073 committed Oct 6, 2022
1 parent a5fc054 commit 17959a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ GitHub actions scripts are available to draft a changelog, draft a release, publ
See the [action details documentation](https://jupyter-releaser.readthedocs.io/en/latest/background/theory.html#action-details) for more information.

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
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.
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.
9 changes: 5 additions & 4 deletions jupyter_releaser/actions/populate_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@

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

if not dry_run:
# Ensure the branch sha has not changed.
ensure_sha()

if not os.environ.get("RH_RELEASE_URL"):
raise RuntimeError("Cannot complete Draft Release, no draft GitHub release url found!")

run_action("jupyter-releaser prep-git")

if not dry_run:
# Ensure the branch sha has not changed.
ensure_sha()

run_action("jupyter-releaser bump-version")
run_action("jupyter-releaser extract-changelog")

Expand Down
2 changes: 1 addition & 1 deletion jupyter_releaser/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def ensure_sha():
run(f"git fetch {remote_name} {branch}", echo=True)
sha = run(f"git rev-parse {remote_name}/{branch}", echo=True)
if sha != current_sha:
log(f"{branch} current sha {sha} is not equal to expected sha {current_sha}")
raise RuntimeError(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 17959a9

Please sign in to comment.