Skip to content

Commit 2c267d5

Browse files
committed
Restore capture of since parameter
Fixes bug introduced in #116
1 parent e1110b4 commit 2c267d5

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
3+
import os
4+
5+
from jupyter_releaser.util import CHECKOUT_NAME
6+
from jupyter_releaser.util import get_latest_tag
7+
from jupyter_releaser.util import log
38
from jupyter_releaser.util import run
49

510
run("jupyter-releaser prep-git")
11+
12+
# Capture the "since" argument in case we add tags befor checking changelog
13+
# Do this before bumping the version
14+
if not os.environ.get("RH_SINCE"):
15+
curr_dir = os.getcwd()
16+
os.chdir(CHECKOUT_NAME)
17+
since = get_latest_tag(os.environ["RH_BRANCH"]) or ""
18+
if since:
19+
log(f"Capturing {since} in RH_SINCE variable")
20+
os.environ["RH_SINCE"] = since
21+
os.chdir(curr_dir)
22+
623
run("jupyter-releaser bump-version")
724
run("jupyter-releaser build-changelog")
825
run("jupyter-releaser draft-changelog")

jupyter_releaser/actions/draft_release.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from jupyter_releaser.changelog import extract_current
99
from jupyter_releaser.util import CHECKOUT_NAME
10+
from jupyter_releaser.util import get_latest_tag
1011
from jupyter_releaser.util import log
1112
from jupyter_releaser.util import run
1213

@@ -31,6 +32,18 @@
3132
run("pip install -q -e .")
3233

3334
run("jupyter-releaser prep-git")
35+
36+
# Capture the "since" argument in case we add tags befor checking changelog
37+
# Do this before bumping the version
38+
if not os.environ.get("RH_SINCE"):
39+
curr_dir = os.getcwd()
40+
os.chdir(CHECKOUT_NAME)
41+
since = get_latest_tag(os.environ["RH_BRANCH"]) or ""
42+
if since:
43+
log(f"Capturing {since} in RH_SINCE variable")
44+
os.environ["RH_SINCE"] = since
45+
os.chdir(curr_dir)
46+
3447
run("jupyter-releaser bump-version")
3548

3649
if check_release:

0 commit comments

Comments
 (0)