Skip to content

Commit 142a92c

Browse files
authored
Use UUID instead of timestamp for changelog entry filenames (#621)
Timestamps weren't unique enough when generating multiple entries for the same package and change type in automated workflows, causing entries to be overwritten.
1 parent ba9e532 commit 142a92c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/changelog/new-entry.py

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

88
import argparse
99
import json
10-
from datetime import datetime
10+
import uuid
1111
from pathlib import Path
1212

1313
PROJECT_ROOT_DIR = Path(__file__).resolve().parent.parent.parent
@@ -33,8 +33,8 @@ def create_change_entry(
3333
next_release_dir.mkdir(exist_ok=True)
3434

3535
# Generate unique filename
36-
timestamp = datetime.now().strftime("%Y%m%d%H%M%S")
37-
filename = f"{package_name}-{change_type}-{timestamp}.json"
36+
unique_id = uuid.uuid4().hex
37+
filename = f"{package_name}-{change_type}-{unique_id}.json"
3838

3939
entry_data = {
4040
"type": change_type,

0 commit comments

Comments
 (0)