Skip to content

Commit

Permalink
feat: pin action.yml dependencies with Ratchet (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradegler authored Feb 10, 2023
1 parent 1796fb3 commit 9556af1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ runs:
using: 'composite'
steps:
- name: 'setup-terraform'
uses: 'hashicorp/setup-terraform@v2'
uses: 'hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1' # ratchet:hashicorp/setup-terraform@v2
with:
terraform_version: '${{ inputs.terraform_version }}'
terraform_wrapper: '${{ inputs.terraform_wrapper }}'
Expand Down
5 changes: 4 additions & 1 deletion cmd/lint-action/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@ func realMain() error {
return fmt.Errorf("expected at least one argument, got %d", got)
}

return linter.RunLinter(ctx, args, &linter.GitHubActionLinter{})
if err := linter.RunLinter(ctx, args, &linter.GitHubActionLinter{}); err != nil {
return fmt.Errorf("error running linter %w", err)
}
return nil
}
5 changes: 4 additions & 1 deletion cmd/lint-terraform/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@ func realMain() error {
return fmt.Errorf("expected at least one argument, got %d", got)
}

return linter.RunLinter(ctx, args, &linter.TerraformLinter{})
if err := linter.RunLinter(ctx, args, &linter.TerraformLinter{}); err != nil {
return fmt.Errorf("error running linter %w", err)
}
return nil
}
4 changes: 2 additions & 2 deletions pkg/linter/linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func lint(path string, linter Linter) ([]*ViolationInstance, error) {
}
results, err := linter.FindViolations(content, path)
if err != nil {
return nil, err
return nil, fmt.Errorf("error searching for violations %w", err)
}
instances = append(instances, results...)
}
Expand All @@ -104,7 +104,7 @@ func lint(path string, linter Linter) ([]*ViolationInstance, error) {
func isDirectory(path string) (bool, error) {
fileInfo, err := os.Stat(path)
if err != nil {
return false, err
return false, fmt.Errorf("error reading file information %w", err)
}
return fileInfo.IsDir(), err
}

0 comments on commit 9556af1

Please sign in to comment.