feat: add message-skipped input to action (#76)

* add message-skipped input to action
This commit is contained in:
Aryella Lacerda 2023-04-22 08:32:11 -03:00 committed by GitHub
parent ec8c4b3b90
commit e4a2f85328
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 1 deletions

View file

@ -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')
})
})