When called from the release workflow, a ReleaseContext is passed to provide release information:
ts
type PrCommentStatus = 'success' | 'no-release' | 'failed'interface ReleaseContext { /** * Release status */ status: PrCommentStatus /** * Bump result (available when status is 'success') */ bumpResult?: BumpResult /** * Git tags created during release */ tags?: string[] /** * Error message (available when status is 'failed') */ error?: string}
prComment()
Post release information as a PR/MR comment programmatically.
Signature
Description
The
prComment()function posts release information as a comment on a pull request or merge request. It automatically:prNumber)appendandupdatemodes for comment managementOptions
ReleaseContext
When called from the release workflow, a
ReleaseContextis passed to provide release information:Return Value
Returns a
Promise<void>that resolves when the comment has been posted successfully, or rejects if an error occurs.Error Handling
The function will throw an error if:
prNumberis providedErrors are logged with detailed messages to help troubleshoot configuration issues.
Examples
Basic Usage
Post a comment on the auto-detected PR:
With PR Number
Specify the PR/MR number manually:
With Pre-loaded Config
Pass configuration directly:
With Release Context
Pass release information for formatted comments:
Dry Run
Preview the comment without posting:
In Full Release Workflow
Custom Log Level
Control logging verbosity:
Type Definitions
See Also