Skip to content

Commit

Permalink
Target module callers when local path module is updated (#1528)
Browse files Browse the repository at this point in the history
* Target module callers when module is changed

* Put the new behavior behind the flag

* Don't install when disabled

* Pin to the stable version

* Rename to update_local_path_module_caller and disable by default

* Call getInput in main

* Declare Golang dependency

* Detect go bin path

* Move to the right place since it depends on global-config

* last slash not needed

* style: format by prettier

* fix(list-module-caller): specify the install path of terraform-config-inspect

* fix(list-targets): fix typo

* fix(list-targets): change the install path of terraform-config-inspect to a temporal directory

It seems that action can't refer files on other actions

* fix: stop installing terraform-config-inspect

You have to install terraform-config-inspect yourself

* fix: remove an input terraform_config_inspect_path

* Use jest

---------

Co-authored-by: Shunsuke Suzuki <[email protected]>
Co-authored-by: Shunsuke Suzuki <[email protected]>
  • Loading branch information
3 people authored Mar 16, 2024
1 parent 61d3e8f commit 6a5ff89
Show file tree
Hide file tree
Showing 26 changed files with 31,082 additions and 10 deletions.
3 changes: 3 additions & 0 deletions check-terraform-skip/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions export-aws-secrets-manager/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions get-global-config/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ outputs:
enable_trivy:
description: If true, trivy is enabled in test action

update_local_path_module_caller:
description: If true, local-path module caller is updated when any of local-path modules is updated. Golang is needed to use this feature.

aqua_update_checksum_enabled:
description: If true, aqua-checksums.json on working directories is updated
aqua_update_checksum_skip_push:
Expand Down
20 changes: 12 additions & 8 deletions get-global-config/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions get-global-config/src/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ test("default", () => {
aqua_update_checksum_enabled: false,
aqua_update_checksum_prune: false,
aqua_update_checksum_skip_push: false,
update_local_path_module_caller: false,

enable_tfsec: false,
enable_tflint: true,
Expand Down Expand Up @@ -82,6 +83,7 @@ test("customize", () => {
draft_pr: true,
skip_create_pr: true,
conftest_policy_directory: "terraform/policy",
update_local_path_module_caller: false,

label_prefix_target: "target:",
label_prefix_tfmigrate: "tfmigrate:",
Expand Down
3 changes: 3 additions & 0 deletions get-global-config/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface Outputs {
drift_issue_repo_owner: string;
drift_issue_repo_name: string;
disable_update_related_pull_requests: boolean;
update_local_path_module_caller: boolean;
aqua_update_checksum_enabled: boolean;
aqua_update_checksum_prune: boolean;
aqua_update_checksum_skip_push: boolean;
Expand Down Expand Up @@ -66,6 +67,8 @@ export const main = (config: lib.Config, input: Input): Result => {
disable_update_related_pull_requests: !(
config?.update_related_pull_requests?.enabled ?? true
),
update_local_path_module_caller:
config?.update_local_path_module_caller?.enabled ?? false,
aqua_update_checksum_enabled:
config?.aqua?.update_checksum?.enabled ?? false,
aqua_update_checksum_prune: config?.aqua?.update_checksum?.prune ?? false,
Expand Down
3 changes: 3 additions & 0 deletions get-target-config/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions lib/dist/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ const Config = z.object({
tflint: z.optional(TflintConfig),
tfsec: z.optional(TfsecConfig),
trivy: z.optional(TrivyConfig),
update_local_path_module_caller: z.optional(
z.object({
enabled: z.optional(z.boolean()),
}),
),
terraform_command: z.optional(z.string()),
update_related_pull_requests: z.optional(
z.object({
Expand Down
1 change: 1 addition & 0 deletions list-module-callers/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.0
15 changes: 15 additions & 0 deletions list-module-callers/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: List module callers
description: List module's callers
inputs:
config_files:
description: "config file paths"
required: true
module_files:
description: "module file paths"
required: true
outputs:
file:
description: A json to list module callers
runs:
using: "node20"
main: "dist/index.js"
145 changes: 145 additions & 0 deletions list-module-callers/dist/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6a5ff89

Please sign in to comment.