ignore skip directive for promote and rollback events

This commit is contained in:
Brad Rydzewski 2021-06-15 15:56:59 -04:00
parent a3863f9395
commit e3f09c867d
2 changed files with 24 additions and 0 deletions

View file

@ -61,6 +61,10 @@ func skipMessage(hook *core.Hook) bool {
return false
case hook.Event == core.EventCustom:
return false
case hook.Event == core.EventPromote:
return false
case hook.Event == core.EventRollback:
return false
case skipMessageEval(hook.Message):
return true
case skipMessageEval(hook.Title):

View file

@ -200,6 +200,26 @@ func Test_skipMessage(t *testing.T) {
title: "update readme [CI SKIP]",
want: false,
},
{
event: "promote",
title: "update readme [CI SKIP]",
want: false,
},
{
event: "promote",
title: "update readme [CI SKIP]",
want: false,
},
{
event: "rollback",
title: "update readme [CI SKIP]",
want: false,
},
{
event: "rollback",
title: "update readme [CI SKIP]",
want: false,
},
}
for _, test := range tests {
hook := &core.Hook{