Skip to content

Commit acfecd9

Browse files
iignatevichdavidferlay
authored andcommitted
#77: Exclude action dir in change detection
1 parent 2887b18 commit acfecd9

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

actionBump.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package plasmactlbump
22

33
import (
44
"path/filepath"
5+
"strings"
56

67
"github.com/launchrctl/launchr"
78

@@ -71,7 +72,23 @@ func (b *BumpAction) getResource(path string) *sync.Resource {
7172
return nil
7273
}
7374

74-
return sync.BuildResourceFromPath(path, ".")
75+
platform, kind, role, err := sync.ProcessResourcePath(path)
76+
if err != nil || (platform == "" || kind == "" || role == "") {
77+
return nil
78+
}
79+
80+
// skip actions dir from triggering bump.
81+
resourceActionsDir := filepath.Join(platform, kind, "roles", role, "actions")
82+
if strings.Contains(path, resourceActionsDir) {
83+
return nil
84+
}
85+
86+
resource := sync.NewResource(sync.PrepareMachineResourceName(platform, kind, role), ".")
87+
if !resource.IsValidResource() {
88+
return nil
89+
}
90+
91+
return resource
7592
}
7693

7794
func (b *BumpAction) collectResources(commits []*repository.Commit) map[string]map[string]*sync.Resource {

0 commit comments

Comments
 (0)