Skip to content

Commit

Permalink
Apply skip ci filter only on push events (#3612)
Browse files Browse the repository at this point in the history
Fixes: #3606
  • Loading branch information
xoxys committed Apr 14, 2024
1 parent 399bc5b commit b4cd1da
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions server/pipeline/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b4cd1da

Please sign in to comment.