Skip to content

Commit 4868556

Browse files
authored
changelog: check more subprocess exit codes, full checkout to get tags and history (#5261)
1 parent 51366c9 commit 4868556

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/changelog.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
# Checkout the repository
2323
- name: Checkout Repository
2424
uses: actions/checkout@v5
25+
with:
26+
fetch-depth: 0
2527

2628
# Run the update script
2729
- name: Run python script

dev/releases/release_notes.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def is_existing_tag(tag: str) -> bool:
4242
f""".[] | select(.name | contains("{tag.strip()}"))"""
4343
],
4444
shell=False,
45+
check=False, # this subprocess is allowed to fail
4546
capture_output=True
4647
)
4748
return res.stdout.decode() != ""
@@ -130,6 +131,7 @@ def get_tag_date(tag: str) -> str:
130131
"--json=createdAt"
131132
],
132133
shell=False,
134+
check=True,
133135
capture_output=True
134136
)
135137
res = json.loads(res.stdout.decode())
@@ -300,15 +302,15 @@ def main(new_version: str) -> None:
300302
"git",
301303
"merge-base",
302304
basetag,
303-
"master"
304-
], shell=False, capture_output=True).stdout.decode().strip()
305+
"HEAD"
306+
], shell=False, check=True, capture_output=True).stdout.decode().strip()
305307
timestamp = subprocess.run([
306308
"git",
307309
"show",
308310
"-s",
309311
"--format=\"%cI\"",
310312
shared_commit
311-
], shell=False, capture_output=True).stdout.decode().strip().replace('"', '')
313+
], shell=False, check=True, capture_output=True).stdout.decode().strip().replace('"', '')
312314
# date is first 10 characters of timestamp
313315
startdate = timestamp[0:10]
314316
print("Base tag is", basetag)
@@ -338,6 +340,7 @@ def main(new_version: str) -> None:
338340
".[] | select(.isLatest == true)"
339341
],
340342
shell=False,
343+
check=True,
341344
capture_output=True
342345
)
343346
itag = json.loads(itag.stdout.decode())["name"][1:]

0 commit comments

Comments
 (0)