Skip to content

Commit

Permalink
Generate the CHANGELOG based on the PR's target branch
Browse files Browse the repository at this point in the history
To fix: #11866

Generate the CHANGELOG based on the PR's target branch if the PR's project roadmap is empty.

Signed-off-by: Tim Liu <[email protected]>
  • Loading branch information
NvTimLiu committed Dec 12, 2024
1 parent 38d66b0 commit cac4b4b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/generate-changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Copyright (c) 2020-2023, NVIDIA CORPORATION.
# Copyright (c) 2020-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -183,9 +183,13 @@ def process_changelog(resource_type: str, changelog: dict, releases: set, projec
if resource_type == PULL_REQUESTS:
if '[bot]' in item['title']:
continue # skip auto-gen PR
no_project_prs.append(item)
continue
project = item['projectCards']['nodes'][0]['project']['name']
# Obtain the version from the PR's target branch, e.g. branch-x.y --> x.y
ver = item['baseRefName'].replace('branch-', '')
project = f"{RELEASE} {ver}"
else:
continue
else:
project = item['projectCards']['nodes'][0]['project']['name']
else:
ver = item["projectItems"]["nodes"][0]['roadmap']['name']
project = f"{RELEASE} {ver}"
Expand Down

0 comments on commit cac4b4b

Please sign in to comment.