Generate release notes using GitHub's API. This respects .github/release.yml for PR categorization.
(head_tag: str, base_tag: str)
| 151 | |
| 152 | |
| 153 | def generate_release_notes(head_tag: str, base_tag: str) -> str: |
| 154 | """ |
| 155 | Generate release notes using GitHub's API. |
| 156 | |
| 157 | This respects .github/release.yml for PR categorization. |
| 158 | """ |
| 159 | result = run_gh( |
| 160 | [ |
| 161 | "api", |
| 162 | f"repos/{REPO}/releases/generate-notes", |
| 163 | "--field", |
| 164 | f"tag_name={head_tag}", |
| 165 | "--field", |
| 166 | f"previous_tag_name={base_tag}", |
| 167 | "--jq", |
| 168 | ".body", |
| 169 | ] |
| 170 | ) |
| 171 | body = result.stdout.strip() |
| 172 | if not body: |
| 173 | raise click.ClickException("GitHub API returned empty release notes") |
| 174 | return body |
| 175 | |
| 176 | |
| 177 | # ============================================================================= |
no test coverage detected