File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 6
6
from subprocess import CalledProcessError
7
7
8
8
from jupyter_releaser .util import CHECKOUT_NAME
9
+ from jupyter_releaser .util import get_latest_tag
9
10
from jupyter_releaser .util import log
10
11
from jupyter_releaser .util import run
11
12
38
39
Path (changelog_location ).write_text (changelog_text )
39
40
40
41
run ("jupyter-releaser check-changelog" )
42
+
43
+ # Capture the "since" argument in case we add tags before the second
44
+ # "Check Changelog"
45
+ curr_dir = os .getcwd ()
46
+ os .chdir (CHECKOUT_NAME )
47
+ os .environ .setdefault ("RH_SINCE" , get_latest_tag (os .environ ["RH_BRANCH" ]))
48
+ os .chdir (curr_dir )
49
+
41
50
# Make sure npm comes before python in case it produces
42
51
# files for the python package
43
52
run ("jupyter-releaser build-npm" )
Original file line number Diff line number Diff line change @@ -65,10 +65,7 @@ def get_version_entry(
65
65
str
66
66
A formatted changelog entry with markers
67
67
"""
68
- if not since :
69
- tags = util .run (f"git --no-pager tag --sort=-creatordate --merged { branch } " )
70
- if tags :
71
- since = tags .splitlines ()[0 ]
68
+ since = since or util .get_latest_tag (branch )
72
69
73
70
branch = branch .split ("/" )[- 1 ]
74
71
util .log (f"Getting changes to { repo } since { since } on branch { branch } ..." )
Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ def invoke(self, ctx):
86
86
before_hooks = hooks [before ]
87
87
if isinstance (before_hooks , str ):
88
88
before_hooks = [before_hooks ]
89
+ if before_hooks :
90
+ util .log (f"\n Running hooks for { before } " )
89
91
for hook in before_hooks :
90
92
util .run (hook )
91
93
@@ -104,6 +106,8 @@ def invoke(self, ctx):
104
106
after_hooks = hooks [after ]
105
107
if isinstance (after_hooks , str ):
106
108
after_hooks = [after_hooks ]
109
+ if after_hooks :
110
+ util .log (f"\n Running hooks for { after } " )
107
111
for hook in after_hooks :
108
112
util .run (hook )
109
113
Original file line number Diff line number Diff line change @@ -243,6 +243,13 @@ def actions_output(name, value):
243
243
print (f"::set-output name={ name } ::{ value } " )
244
244
245
245
246
+ def get_latest_tag (branch ):
247
+ """Get the default 'since' value for a branch"""
248
+ tags = run (f"git --no-pager tag --sort=-creatordate --merged { branch } " )
249
+ if tags :
250
+ return tags .splitlines ()[0 ]
251
+
252
+
246
253
def read_config ():
247
254
"""Read the jupyter-releaser config data"""
248
255
if JUPYTER_RELEASER_CONFIG .exists ():
You can’t perform that action at this time.
0 commit comments