Skip to content

Commit

Permalink
Aggregate terraform errors
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Dec 7, 2022
1 parent f3818d2 commit 7839a7e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions terraform/lib/dependabot/terraform/file_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ def lookup_hash_architecture # rubocop:disable Metrics/AbcSize, Metrics/MethodLe
# Terraform will update the lockfile in place so we use a fresh lockfile for each lookup
File.write(".terraform.lock.hcl", lockfile_hash_removed)

SharedHelpers.run_shell_command("terraform providers lock -platform=#{arch} #{provider_source} -no-color")
SharedHelpers.run_shell_command(
"terraform providers lock -platform=#{arch} #{provider_source} -no-color",
fingerprint: "terraform providers lock -platform=<arch> <provider_source> -no-color"
)

updated_lockfile = File.read(".terraform.lock.hcl")
updated_hashes = extract_provider_h1_hashes(updated_lockfile, declaration_regex)
Expand Down Expand Up @@ -228,7 +231,10 @@ def update_lockfile_declaration(updated_manifest_files) # rubocop:disable Metric

File.write(".terraform.lock.hcl", lockfile_dependency_removed)

SharedHelpers.run_shell_command("terraform providers lock #{platforms} #{provider_source}")
SharedHelpers.run_shell_command(
"terraform providers lock #{platforms} #{provider_source}",
fingerprint: "terraform providers lock <platforms> <provider_source>"
)

updated_lockfile = File.read(".terraform.lock.hcl")
updated_dependency = updated_lockfile.scan(declaration_regex).first
Expand Down

0 comments on commit 7839a7e

Please sign in to comment.