mirror of
https://github.com/mshick/add-pr-comment.git
synced 2026-01-01 22:49:45 +11:00
feat: add message-skipped input to action (#76)
* add message-skipped input to action
This commit is contained in:
parent
ec8c4b3b90
commit
e4a2f85328
5 changed files with 38 additions and 1 deletions
|
|
@ -22,7 +22,8 @@ type Inputs = {
|
|||
'message-success'?: string
|
||||
'message-failure'?: string
|
||||
'message-cancelled'?: string
|
||||
status?: 'success' | 'failure' | 'cancelled'
|
||||
'message-skipped'?: string
|
||||
status?: 'success' | 'failure' | 'cancelled' | 'skipped'
|
||||
}
|
||||
|
||||
const inputs: Inputs = {
|
||||
|
|
@ -307,4 +308,27 @@ describe('add-pr-comment action', () => {
|
|||
await run()
|
||||
expect(messagePayload?.body).toContain('666')
|
||||
})
|
||||
|
||||
it('overrides the default message with a skipped message on skipped', async () => {
|
||||
inputs.message = simpleMessage
|
||||
inputs['message-path'] = undefined
|
||||
inputs['repo-token'] = repoToken
|
||||
inputs['allow-repeats'] = 'false'
|
||||
inputs['message-skipped'] = '666'
|
||||
inputs.status = 'skipped'
|
||||
|
||||
const commentId = 123
|
||||
|
||||
getIssueCommentsResponse = [
|
||||
{
|
||||
id: commentId,
|
||||
},
|
||||
]
|
||||
postIssueCommentsResponse = {
|
||||
id: commentId,
|
||||
}
|
||||
|
||||
await run()
|
||||
expect(messagePayload?.body).toContain('666')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue