Skip to content

Conversation

ncipollo
Copy link
Owner

When updating a release, we not take the omitBodyDuringUpdate input into account before we generated release notes (so body doesn't get replaced).

@ncipollo ncipollo requested a review from Copilot April 30, 2025 12:01
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes #513 by ensuring that release notes are not generated during an update when the input omitBodyDuringUpdate is set. Key changes include adding the new input property to the Inputs interface and class, updating the logic in Action.ts to conditionally bypass release notes generation, and extending test coverage to verify the new behavior.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Inputs.ts Adds the omitBodyDuringUpdate input and implements corresponding getters.
src/Action.ts Modifies release update logic to conditionally generate release notes.
tests/Integration.test.ts Updates integration tests with the new omitBodyDuringUpdate property.
tests/Inputs.test.ts Adds tests for the omitBodyDuringUpdate behavior.
tests/Action.test.ts Extends tests verifying that release notes are not generated when omitBodyDuringUpdate is true.

@@ -217,17 +218,21 @@ export class CoreInputs implements Inputs {
return this.body
}

Copy link
Preview

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The separation between the instance getter 'updateOnlyUnreleased' and the static getter 'omitBodyDuringUpdate' may be confusing to future maintainers. Consider adding inline documentation to clarify the distinct roles and intended usage of these two getters.

Suggested change
/**
* Instance-level getter to determine if updates should only apply to unreleased versions.
* This is based on the current instance's context and retrieves the value from the input.
*/

Copilot uses AI. Check for mistakes.

@@ -93,7 +93,7 @@ export class Action {
private async updateRelease(id: number): Promise<UpdateReleaseResponse> {
let releaseBody = this.inputs.updatedReleaseBody

Copy link
Preview

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Although the conditional logic is correct, an inline comment explaining why omitBodyDuringUpdate is negated in this condition would improve clarity for future code maintenance.

Suggested change
// Only update the release body with generated release notes if omitBodyDuringUpdate is false.

Copilot uses AI. Check for mistakes.

@ncipollo ncipollo merged commit fa47493 into main May 11, 2025
3 checks passed
@ncipollo ncipollo deleted the ncipollo/513/avoid-generate-notes-when-omit-on branch May 11, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant