mirror of
https://github.com/mshick/add-pr-comment.git
synced 2026-01-01 22:49:45 +11:00
Add update-only configuration option (#92)
This commit is contained in:
parent
387ece43e3
commit
1dff58b1a3
11 changed files with 3311 additions and 10787 deletions
|
|
@ -24,6 +24,7 @@ type Inputs = {
|
|||
'message-failure'?: string
|
||||
'message-cancelled'?: string
|
||||
'message-skipped'?: string
|
||||
'update-only'?: string
|
||||
status?: 'success' | 'failure' | 'cancelled' | 'skipped'
|
||||
}
|
||||
|
||||
|
|
@ -175,6 +176,15 @@ describe('add-pr-comment action', () => {
|
|||
expect(core.setOutput).toHaveBeenCalledWith('comment-created', 'true')
|
||||
})
|
||||
|
||||
it('does not create a comment when updateOnly is true and no existing comment is found', async () => {
|
||||
inputs.message = simpleMessage
|
||||
inputs['allow-repeats'] = 'true'
|
||||
inputs['update-only'] = 'true'
|
||||
|
||||
await expect(run()).resolves.not.toThrow()
|
||||
expect(core.setOutput).toHaveBeenCalledWith('comment-created', 'false')
|
||||
})
|
||||
|
||||
it('creates a comment in another repo', async () => {
|
||||
inputs.message = simpleMessage
|
||||
inputs['repo-owner'] = 'my-owner'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue