Skip to content

Commit

Permalink
fix default branch regexp (#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnomus authored Jun 5, 2023
1 parent 718e730 commit a894122
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions docs/configuration_syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ project_defaults:
enabled: true

# Filter for branches to include
# (optional, default: "^main|master$" -- main/master branches)
regexp: "^main|master$"
# (optional, default: "^(?:main|master)$" -- main/master branches)
regexp: "^(?:main|master)$"

# Only keep most 'n' recently updated branches
# (optional, default: 0 -- disabled/keep every branch matching the regexp)"
Expand Down Expand Up @@ -354,8 +354,8 @@ projects:
enabled: true

# Filter for branches to include
# (optional, default: "^main|master$" -- main/master branches)
regexp: "^main|master$"
# (optional, default: "^(?:main|master)$" -- main/master branches)
regexp: "^(?:main|master)$"

# Only keep most 'n' recently updated branches
# (optional, default: 0 -- disabled/keep every branch matching the regexp)"
Expand Down Expand Up @@ -481,8 +481,8 @@ wildcards:
enabled: true

# Filter for branches to include
# (optional, default: "^main|master$" -- main/master branches)
regexp: "^main|master$"
# (optional, default: "^(?:main|master)$" -- main/master branches)
regexp: "^(?:main|master)$"

# Only keep most 'n' recently updated branches
# (optional, default: 0 -- disabled/keep every branch matching the regexp)"
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestNew(t *testing.T) {
c.ProjectDefaults.Pull.Environments.ExcludeStopped = true

c.ProjectDefaults.Pull.Refs.Branches.Enabled = true
c.ProjectDefaults.Pull.Refs.Branches.Regexp = `^main|master$`
c.ProjectDefaults.Pull.Refs.Branches.Regexp = `^(?:main|master)$`
c.ProjectDefaults.Pull.Refs.Branches.ExcludeDeleted = true

c.ProjectDefaults.Pull.Refs.Tags.Enabled = true
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type ProjectPullRefsBranches struct {
Enabled bool `default:"true" yaml:"enabled"`

// Filter for branches to include
Regexp string `default:"^main|master$" yaml:"regexp"`
Regexp string `default:"^(?:main|master)$" yaml:"regexp"`

// Only keep most 'n' recently updated branches
MostRecent uint `default:"0" yaml:"most_recent"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestNewProject(t *testing.T) {
p.Pull.Environments.ExcludeStopped = true

p.Pull.Refs.Branches.Enabled = true
p.Pull.Refs.Branches.Regexp = `^main|master$`
p.Pull.Refs.Branches.Regexp = `^(?:main|master)$`
p.Pull.Refs.Branches.ExcludeDeleted = true

p.Pull.Refs.Tags.Enabled = true
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/wildcard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestNewWildcard(t *testing.T) {
w.Pull.Environments.ExcludeStopped = true

w.Pull.Refs.Branches.Enabled = true
w.Pull.Refs.Branches.Regexp = `^main|master$`
w.Pull.Refs.Branches.Regexp = `^(?:main|master)$`
w.Pull.Refs.Branches.ExcludeDeleted = true

w.Pull.Refs.Tags.Enabled = true
Expand Down

0 comments on commit a894122

Please sign in to comment.