From b4cd1da29cfa0ff082f1a3b327e931b9a9a11449 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 14 Apr 2024 14:25:28 +0200 Subject: [PATCH] Apply skip ci filter only on push events (#3612) Fixes: https://github.com/woodpecker-ci/woodpecker/issues/3606 --- server/pipeline/create.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/server/pipeline/create.go b/server/pipeline/create.go index c81881c0a..cf8938b64 100644 --- a/server/pipeline/create.go +++ b/server/pipeline/create.go @@ -42,14 +42,16 @@ func Create(ctx context.Context, _store store.Store, repo *model.Repo, pipeline return nil, fmt.Errorf(msg) } - skipMatch := skipPipelineRegex.FindString(pipeline.Message) - if len(skipMatch) > 0 { - ref := pipeline.Commit - if len(ref) == 0 { - ref = pipeline.Ref + if pipeline.Event == model.EventPush || pipeline.Event == model.EventPull || pipeline.Event == model.EventPullClosed { + skipMatch := skipPipelineRegex.FindString(pipeline.Message) + if len(skipMatch) > 0 { + ref := pipeline.Commit + if len(ref) == 0 { + ref = pipeline.Ref + } + log.Debug().Str("repo", repo.FullName).Msgf("ignoring pipeline as skip-ci was found in the commit (%s) message '%s'", ref, pipeline.Message) + return nil, ErrFiltered } - log.Debug().Str("repo", repo.FullName).Msgf("ignoring pipeline as skip-ci was found in the commit (%s) message '%s'", ref, pipeline.Message) - return nil, ErrFiltered } // If the forge has a refresh token, the current access token