Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ensure_sha #427

Merged
merged 2 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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