mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
Don't run Buildkite CI on .github config changes (#25271)
This commit is contained in:
parent
5b2780e5d4
commit
58f7e1f95f
@ -17,6 +17,16 @@ func (c ChangedFiles) onlyDocs() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// onlyConfig returns whether the ChangedFiles are only config file changes that don't need to run CI.
|
||||
func (c ChangedFiles) onlyConfig() bool {
|
||||
for _, p := range c {
|
||||
if !strings.HasPrefix(p, ".github/") {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// onlySg returns whether the ChangedFiles are only in the ./dev/sg folder.
|
||||
func (c ChangedFiles) onlySg() bool {
|
||||
for _, p := range c {
|
||||
|
||||
@ -45,6 +45,10 @@ func CoreTestOperations(changedFiles ChangedFiles, buildOptions bk.BuildOptions)
|
||||
|
||||
// Build special pipelines for changes that only touch a subset of code.
|
||||
switch {
|
||||
case changedFiles.onlyConfig():
|
||||
// If this PR only affects e.g. .github config files, no steps are necessary to run.
|
||||
operations = []Operation{}
|
||||
|
||||
case changedFiles.onlyDocs():
|
||||
// If this is a docs-only PR, run only the steps necessary to verify the docs.
|
||||
operations = []Operation{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user