From 625b96926e2fe8314c49e2971592d5a38a4aaa11 Mon Sep 17 00:00:00 2001 From: "Afshin T. Darian" Date: Wed, 18 Aug 2021 21:03:52 +0100 Subject: [PATCH] Fix Create Changelog Action --- jupyter_releaser/actions/draft_changelog.py | 17 +++++++++++++++++ jupyter_releaser/actions/draft_release.py | 3 +-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/jupyter_releaser/actions/draft_changelog.py b/jupyter_releaser/actions/draft_changelog.py index 47176d5a..4d68e86f 100644 --- a/jupyter_releaser/actions/draft_changelog.py +++ b/jupyter_releaser/actions/draft_changelog.py @@ -1,8 +1,25 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. +import os + +from jupyter_releaser.util import CHECKOUT_NAME +from jupyter_releaser.util import get_latest_tag +from jupyter_releaser.util import log from jupyter_releaser.util import run run("jupyter-releaser prep-git") + +# Capture the "since" argument in case we add tags befor checking changelog +# Do this before bumping the version +if not os.environ.get("RH_SINCE"): + curr_dir = os.getcwd() + os.chdir(CHECKOUT_NAME) + since = get_latest_tag(os.environ["RH_BRANCH"]) or "" + if since: + log(f"Capturing {since} in RH_SINCE variable") + os.environ["RH_SINCE"] = since + os.chdir(curr_dir) + run("jupyter-releaser bump-version") run("jupyter-releaser build-changelog") run("jupyter-releaser draft-changelog") diff --git a/jupyter_releaser/actions/draft_release.py b/jupyter_releaser/actions/draft_release.py index c1d44137..64b364aa 100644 --- a/jupyter_releaser/actions/draft_release.py +++ b/jupyter_releaser/actions/draft_release.py @@ -33,8 +33,7 @@ run("jupyter-releaser prep-git") -# Capture the "since" argument in case we add tags before the second -# "Check Changelog" +# Capture the "since" argument in case we add tags befor checking changelog # Do this before bumping the version if not os.environ.get("RH_SINCE"): curr_dir = os.getcwd()