ci: generate pr notes based off base version#1098
Conversation
Multiple PRs could result in incomplete change logs.
WalkthroughA new step was added to the GitHub Actions workflow to generate release notes for prereleases by comparing the current PR version tag against the base tag. The generated notes are saved to a markdown file and used as the prerelease body instead of automatic note generation. Changes
Sequence Diagram(s)sequenceDiagram
participant Workflow
participant GitHub CLI (gh)
participant Release Notes File
Workflow->>GitHub CLI (gh): Fetch commits between base and head tags
GitHub CLI (gh)-->>Workflow: Return commit data
Workflow->>Release Notes File: Format and save release-notes.md with commits and PR link
Workflow->>GitHub CLI (gh): Upload prerelease using release-notes.md as release body
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/workflows/build.yaml (2)
121-126: Add error handling around note extraction.If
gh release viewfails (e.g., permissions or missing draft), the workflow will error out. Consider wrapping this in a conditional to provide a fallback empty file and emit a clear warning.Example:
- gh release view "$TAG-temp" \ - --repo "$GITHUB_REPOSITORY" \ - --json body \ - --jq .body > release-notes.md + if gh release view "$TAG-temp" \ + --repo "$GITHUB_REPOSITORY" \ + --json body \ + --jq .body > release-notes.md; then + echo "✅ Release notes extracted." + else + echo "⚠️ Failed to extract notes; creating empty file." >&2 + : > release-notes.md + fi
127-132: Consistent Markdown formatting for appended PR link.The current sequence works, but using a single
printfimproves readability and avoids stray newlines if the generated notes don’t end with one.- { - echo "" - echo "---" - echo "[View Pull Request]($PR_URL)" - } >> release-notes.md + printf "\n---\n[View Pull Request](%s)\n" "$PR_URL" >> release-notes.md
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/build.yaml(1 hunks)
🔇 Additional comments (2)
.github/workflows/build.yaml (2)
145-145: ValidatebodyFilepresence before upload.You’ve replaced
generateReleaseNotes: truewithbodyFile: release-notes.md. Ensure this file exists in the workflow’s working directory when the release step runs, or the action will fail.As a check, you might add before this step:
- name: Verify release notes file run: ls -lah release-notes.md
103-112:Details
✅ Verification successful
Verify GH CLI availability and env configuration.
This step assumes that the
ghCLI is preinstalled onwindows-latestand that exportingGITHUB_TOKENis sufficient for authentication. Please confirm:
- The runner has
ghinstalled (gh --version).gh auth statussucceeds using the providedGITHUB_TOKEN.You can verify with:
🏁 Script executed:
#!/bin/bash if ! command -v gh &> /dev/null; then echo "Error: GH CLI is not installed." >&2 exit 1 fi gh --version gh auth statusLength of output: 341
GH CLI availability and authentication verified
gh version 2.72.0is present on thewindows-latestrunner.gh auth statusconfirms authentication ascoderabbitai[bot]using the providedGITHUB_TOKEN.No changes required.
|
Don't merge, let the rabbit review. |
|
@coderabbitai Please review latest commits. |
* ci: generate pr notes based off base version Multiple PRs could result in incomplete change logs. * ci: use gh client instead of temp tags
Multiple PRs could result in incomplete change logs.
Summary by CodeRabbit