diff options
author | Natasha Pirogova <galnat@ydb.tech> | 2025-03-13 11:14:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-13 11:14:30 +0300 |
commit | 6cbf6c91db22fec151a838331e07ff1b9ae55d23 (patch) | |
tree | a2018ed7ec0b826802c3388af902619cd18bd74d | |
parent | 635bacbd66128235b9535e2c6d9b4c031c7aede8 (diff) | |
download | ydb-6cbf6c91db22fec151a838331e07ff1b9ae55d23.tar.gz |
Fix validate PR description script (#15678)
-rw-r--r-- | .github/actions/update_changelog/update_changelog.py | 6 | ||||
-rw-r--r-- | .github/workflows/validate_pr_description.yml | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/.github/actions/update_changelog/update_changelog.py b/.github/actions/update_changelog/update_changelog.py index 538703705b..bdfeb69ad5 100644 --- a/.github/actions/update_changelog/update_changelog.py +++ b/.github/actions/update_changelog/update_changelog.py @@ -123,7 +123,8 @@ def update_changelog(changelog_path, pr_data): if validate_pr_description(pr["body"], is_not_for_cl_valid=False): category = extract_changelog_category(pr["body"]) category = match_pr_to_changelog_category(category) - body = extract_changelog_body(pr["body"]) + dirty_body = extract_changelog_body(pr["body"]) + body = dirty_body.replace("\r", "") if category and body: body += f" [#{pr['number']}]({pr['url']})" body += f" ([{pr['name']}]({pr['user_url']}))" @@ -190,12 +191,13 @@ if __name__ == "__main__": try: pr_details = fetch_pr_details(pr["id"]) user_details = fetch_user_details(pr_details["user"]["login"]) + name = user_details.get("name", None) if validate_pr_description(pr_details["body"], is_not_for_cl_valid=False): pr_data.append({ "number": pr_details["number"], "body": pr_details["body"].strip(), "url": pr_details["html_url"], - "name": user_details.get("name", pr_details["user"]["login"]), # Use login if name is not available + "name": name or pr_details["user"]["login"], # Use login if name is not available "user_url": pr_details["user"]["html_url"] }) except Exception as e: diff --git a/.github/workflows/validate_pr_description.yml b/.github/workflows/validate_pr_description.yml index 8a60266d8b..2fb48d90ab 100644 --- a/.github/workflows/validate_pr_description.yml +++ b/.github/workflows/validate_pr_description.yml @@ -16,6 +16,8 @@ jobs: steps: - name: Check out the repository uses: actions/checkout@v4 + with: + ref: main - name: Use custom PR validation action id: validate |