Skip to content

Commit

Permalink
Fix policy check loading the tf version (#1658)
Browse files Browse the repository at this point in the history
  • Loading branch information
msarvar authored Jun 23, 2021
1 parent 7607c15 commit 0ed7a43
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/events/project_command_context_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ func (cb *PolicyCheckProjectCommandContextBuilder) BuildProjectContext(
) (projectCmds []models.ProjectCommandContext) {
ctx.Log.Debug("PolicyChecks are enabled")

// If TerraformVersion not defined in config file look for a
// terraform.require_version block.
if prjCfg.TerraformVersion == nil {
prjCfg.TerraformVersion = getTfVersion(ctx, filepath.Join(repoDir, prjCfg.RepoRelDir))
}

projectCmds = cb.ProjectCommandContextBuilder.BuildProjectContext(
ctx,
cmdName,
Expand Down

0 comments on commit 0ed7a43

Please sign in to comment.