File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
1919 "github.com/diggerhq/digger/libs/scheduler"
2020 "github.com/diggerhq/digger/libs/storage"
2121 "github.com/google/go-github/v61/github"
22+ "github.com/samber/lo"
2223 "gopkg.in/yaml.v3"
2324 "log/slog"
2425 "os"
@@ -181,11 +182,21 @@ func GitHubCI(lock core_locking.Lock, policyCheckerProvider core_policy.PolicyCh
181182 usage .ReportErrorAndExit (githubActor , fmt .Sprintf ("Failed to run commands. %s" , err ), 8 )
182183 }
183184 } else if runningMode == "drift-detection" {
184-
185+ blockFiltersStr := os .Getenv ("INPUT_DIGGER_BLOCK_FILTERS" )
186+ blockFilters := strings .Split (blockFiltersStr , "," )
185187 for _ , projectConfig := range diggerConfig .Projects {
186188 if ! projectConfig .DriftDetection {
187189 continue
188190 }
191+ if len (blockFilters ) > 0 {
192+ projectInBlock := false
193+ if lo .Contains (blockFilters , projectConfig .BlockName ) {
194+ projectInBlock = true
195+ }
196+ if ! projectInBlock {
197+ continue
198+ }
199+ }
189200 workflow := diggerConfig .Workflows [projectConfig .Workflow ]
190201
191202 stateEnvVars , commandEnvVars := digger_config .CollectTerraformEnvConfig (workflow .EnvVars , true )
You can’t perform that action at this time.
0 commit comments