diff --git a/check-terraform-skip/dist/index.js b/check-terraform-skip/dist/index.js index b75ea8564..327c7f06d 100644 --- a/check-terraform-skip/dist/index.js +++ b/check-terraform-skip/dist/index.js @@ -24866,6 +24866,9 @@ const Config = zod_1.z.object({ tflint: zod_1.z.optional(TflintConfig), tfsec: zod_1.z.optional(TfsecConfig), trivy: zod_1.z.optional(TrivyConfig), + update_local_path_module_caller: zod_1.z.optional(zod_1.z.object({ + enabled: zod_1.z.optional(zod_1.z.boolean()), + })), update_related_pull_requests: zod_1.z.optional(zod_1.z.object({ enabled: zod_1.z.optional(zod_1.z.boolean()), })), diff --git a/export-aws-secrets-manager/dist/index.js b/export-aws-secrets-manager/dist/index.js index 67405d6be..85dd3f2ea 100644 --- a/export-aws-secrets-manager/dist/index.js +++ b/export-aws-secrets-manager/dist/index.js @@ -44930,6 +44930,9 @@ const Config = zod_1.z.object({ tflint: zod_1.z.optional(TflintConfig), tfsec: zod_1.z.optional(TfsecConfig), trivy: zod_1.z.optional(TrivyConfig), + update_local_path_module_caller: zod_1.z.optional(zod_1.z.object({ + enabled: zod_1.z.optional(zod_1.z.boolean()), + })), update_related_pull_requests: zod_1.z.optional(zod_1.z.object({ enabled: zod_1.z.optional(zod_1.z.boolean()), })), diff --git a/get-global-config/action.yaml b/get-global-config/action.yaml index c71add122..4be4f088f 100644 --- a/get-global-config/action.yaml +++ b/get-global-config/action.yaml @@ -31,6 +31,9 @@ outputs: enable_trivy: description: If true, trivy is enabled in test action + disable_update_local_path_module_caller: + description: If true, local-path module caller is updated when any of local-path modules is updated + aqua_update_checksum_enabled: description: If true, aqua-checksums.json on working directories is updated aqua_update_checksum_skip_push: diff --git a/get-global-config/dist/index.js b/get-global-config/dist/index.js index dd20bbb12..663c471ee 100644 --- a/get-global-config/dist/index.js +++ b/get-global-config/dist/index.js @@ -24866,6 +24866,9 @@ const Config = zod_1.z.object({ tflint: zod_1.z.optional(TflintConfig), tfsec: zod_1.z.optional(TfsecConfig), trivy: zod_1.z.optional(TrivyConfig), + update_local_path_module_caller: zod_1.z.optional(zod_1.z.object({ + enabled: zod_1.z.optional(zod_1.z.boolean()), + })), update_related_pull_requests: zod_1.z.optional(zod_1.z.object({ enabled: zod_1.z.optional(zod_1.z.boolean()), })), @@ -58021,7 +58024,7 @@ catch (error) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.main = void 0; const main = (config, input) => { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y; + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; if (!config.plan_workflow_name) { throw new Error('The setting "plan_workflow_name" is required in tfaction-root.yaml'); } @@ -58039,19 +58042,20 @@ const main = (config, input) => { label_prefix_tfmigrate: ((_c = config === null || config === void 0 ? void 0 : config.label_prefixes) === null || _c === void 0 ? void 0 : _c.tfmigrate) || "tfmigrate:", label_prefix_skip: ((_d = config === null || config === void 0 ? void 0 : config.label_prefixes) === null || _d === void 0 ? void 0 : _d.skip) || "skip:", disable_update_related_pull_requests: !((_f = (_e = config === null || config === void 0 ? void 0 : config.update_related_pull_requests) === null || _e === void 0 ? void 0 : _e.enabled) !== null && _f !== void 0 ? _f : true), - aqua_update_checksum_enabled: (_j = (_h = (_g = config === null || config === void 0 ? void 0 : config.aqua) === null || _g === void 0 ? void 0 : _g.update_checksum) === null || _h === void 0 ? void 0 : _h.enabled) !== null && _j !== void 0 ? _j : false, - aqua_update_checksum_prune: (_m = (_l = (_k = config === null || config === void 0 ? void 0 : config.aqua) === null || _k === void 0 ? void 0 : _k.update_checksum) === null || _l === void 0 ? void 0 : _l.prune) !== null && _m !== void 0 ? _m : false, + disable_update_local_path_module_caller: !((_h = (_g = config === null || config === void 0 ? void 0 : config.update_local_path_module_caller) === null || _g === void 0 ? void 0 : _g.enabled) !== null && _h !== void 0 ? _h : false), + aqua_update_checksum_enabled: (_l = (_k = (_j = config === null || config === void 0 ? void 0 : config.aqua) === null || _j === void 0 ? void 0 : _j.update_checksum) === null || _k === void 0 ? void 0 : _k.enabled) !== null && _l !== void 0 ? _l : false, + aqua_update_checksum_prune: (_p = (_o = (_m = config === null || config === void 0 ? void 0 : config.aqua) === null || _m === void 0 ? void 0 : _m.update_checksum) === null || _o === void 0 ? void 0 : _o.prune) !== null && _p !== void 0 ? _p : false, aqua_update_checksum_skip_push: input.drift_issue_number ? true - : (_q = (_p = (_o = config === null || config === void 0 ? void 0 : config.aqua) === null || _o === void 0 ? void 0 : _o.update_checksum) === null || _p === void 0 ? void 0 : _p.skip_push) !== null && _q !== void 0 ? _q : false, - enable_tfsec: (_s = (_r = config === null || config === void 0 ? void 0 : config.tfsec) === null || _r === void 0 ? void 0 : _r.enabled) !== null && _s !== void 0 ? _s : false, - enable_tflint: (_u = (_t = config === null || config === void 0 ? void 0 : config.tflint) === null || _t === void 0 ? void 0 : _t.enabled) !== null && _u !== void 0 ? _u : true, - enable_trivy: (_w = (_v = config === null || config === void 0 ? void 0 : config.trivy) === null || _v === void 0 ? void 0 : _v.enabled) !== null && _w !== void 0 ? _w : true, + : (_s = (_r = (_q = config === null || config === void 0 ? void 0 : config.aqua) === null || _q === void 0 ? void 0 : _q.update_checksum) === null || _r === void 0 ? void 0 : _r.skip_push) !== null && _s !== void 0 ? _s : false, + enable_tfsec: (_u = (_t = config === null || config === void 0 ? void 0 : config.tfsec) === null || _t === void 0 ? void 0 : _t.enabled) !== null && _u !== void 0 ? _u : false, + enable_tflint: (_w = (_v = config === null || config === void 0 ? void 0 : config.tflint) === null || _v === void 0 ? void 0 : _v.enabled) !== null && _w !== void 0 ? _w : true, + enable_trivy: (_y = (_x = config === null || config === void 0 ? void 0 : config.trivy) === null || _x === void 0 ? void 0 : _x.enabled) !== null && _y !== void 0 ? _y : true, drift_issue_repo_owner: "", drift_issue_repo_name: "", }; const envs = { - TFACTION_SKIP_ADDING_AQUA_PACKAGES: (_y = (_x = config === null || config === void 0 ? void 0 : config.scaffold_working_directory) === null || _x === void 0 ? void 0 : _x.skip_adding_aqua_packages) !== null && _y !== void 0 ? _y : true, + TFACTION_SKIP_ADDING_AQUA_PACKAGES: (_0 = (_z = config === null || config === void 0 ? void 0 : config.scaffold_working_directory) === null || _z === void 0 ? void 0 : _z.skip_adding_aqua_packages) !== null && _0 !== void 0 ? _0 : true, }; if (config.drift_detection && config.drift_detection.issue_repo_owner) { outputs.drift_issue_repo_owner = config.drift_detection.issue_repo_owner; diff --git a/get-global-config/src/run.ts b/get-global-config/src/run.ts index b60e0a1cc..1f7850cf8 100644 --- a/get-global-config/src/run.ts +++ b/get-global-config/src/run.ts @@ -27,6 +27,7 @@ interface Outputs { drift_issue_repo_owner: string; drift_issue_repo_name: string; disable_update_related_pull_requests: boolean; + disable_update_local_path_module_caller: boolean; aqua_update_checksum_enabled: boolean; aqua_update_checksum_prune: boolean; aqua_update_checksum_skip_push: boolean; @@ -64,6 +65,9 @@ export const main = (config: lib.Config, input: Input): Result => { disable_update_related_pull_requests: !( config?.update_related_pull_requests?.enabled ?? true ), + disable_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, diff --git a/get-target-config/dist/index.js b/get-target-config/dist/index.js index b6581ed9e..282634dd5 100644 --- a/get-target-config/dist/index.js +++ b/get-target-config/dist/index.js @@ -24866,6 +24866,9 @@ const Config = zod_1.z.object({ tflint: zod_1.z.optional(TflintConfig), tfsec: zod_1.z.optional(TfsecConfig), trivy: zod_1.z.optional(TrivyConfig), + update_local_path_module_caller: zod_1.z.optional(zod_1.z.object({ + enabled: zod_1.z.optional(zod_1.z.boolean()), + })), update_related_pull_requests: zod_1.z.optional(zod_1.z.object({ enabled: zod_1.z.optional(zod_1.z.boolean()), })), diff --git a/lib/dist/index.d.ts b/lib/dist/index.d.ts index f8ab53874..d4f68db4a 100644 --- a/lib/dist/index.d.ts +++ b/lib/dist/index.d.ts @@ -2532,6 +2532,13 @@ declare const Config: z.ZodObject<{ }, { enabled?: boolean | undefined; }>>; + update_local_path_module_caller: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + enabled?: boolean | undefined; + }, { + enabled?: boolean | undefined; + }>>; update_related_pull_requests: z.ZodOptional; }, "strip", z.ZodTypeAny, { @@ -2714,6 +2721,9 @@ declare const Config: z.ZodObject<{ trivy?: { enabled?: boolean | undefined; } | undefined; + update_local_path_module_caller?: { + enabled?: boolean | undefined; + } | undefined; update_related_pull_requests?: { enabled?: boolean | undefined; } | undefined; @@ -2892,6 +2902,9 @@ declare const Config: z.ZodObject<{ trivy?: { enabled?: boolean | undefined; } | undefined; + update_local_path_module_caller?: { + enabled?: boolean | undefined; + } | undefined; update_related_pull_requests?: { enabled?: boolean | undefined; } | undefined; diff --git a/lib/dist/index.js b/lib/dist/index.js index fa07a5353..62c0c4b75 100644 --- a/lib/dist/index.js +++ b/lib/dist/index.js @@ -158,6 +158,9 @@ const Config = zod_1.z.object({ tflint: zod_1.z.optional(TflintConfig), tfsec: zod_1.z.optional(TfsecConfig), trivy: zod_1.z.optional(TrivyConfig), + update_local_path_module_caller: zod_1.z.optional(zod_1.z.object({ + enabled: zod_1.z.optional(zod_1.z.boolean()), + })), update_related_pull_requests: zod_1.z.optional(zod_1.z.object({ enabled: zod_1.z.optional(zod_1.z.boolean()), })), diff --git a/lib/src/index.ts b/lib/src/index.ts index 7a6e0f518..61798b6b9 100644 --- a/lib/src/index.ts +++ b/lib/src/index.ts @@ -182,6 +182,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()), + }), + ), update_related_pull_requests: z.optional( z.object({ enabled: z.optional(z.boolean()), diff --git a/list-targets-with-changed-files/dist/index.js b/list-targets-with-changed-files/dist/index.js index 8e6002cc5..425bf8252 100644 --- a/list-targets-with-changed-files/dist/index.js +++ b/list-targets-with-changed-files/dist/index.js @@ -165,6 +165,9 @@ const Config = zod_1.z.object({ tflint: zod_1.z.optional(TflintConfig), tfsec: zod_1.z.optional(TfsecConfig), trivy: zod_1.z.optional(TrivyConfig), + update_local_path_module_caller: zod_1.z.optional(zod_1.z.object({ + enabled: zod_1.z.optional(zod_1.z.boolean()), + })), update_related_pull_requests: zod_1.z.optional(zod_1.z.object({ enabled: zod_1.z.optional(zod_1.z.boolean()), })), @@ -62347,7 +62350,7 @@ const run = (input) => { continue; } } - const moduleCallerMap = JSON.parse(core.getInput("module_callers")); + const moduleCallerMap = JSON.parse(core.getInput("module_callers") || "{}"); const changedWorkingDirs = new Set(); for (let i = 0; i < changedFiles.length; i++) { const changedFile = changedFiles[i]; diff --git a/list-targets-with-changed-files/src/run.ts b/list-targets-with-changed-files/src/run.ts index 068efe252..6e852bfbd 100644 --- a/list-targets-with-changed-files/src/run.ts +++ b/list-targets-with-changed-files/src/run.ts @@ -153,7 +153,7 @@ export const run = (input: Input): TargetConfig[] => { } } - const moduleCallerMap = JSON.parse(core.getInput("module_callers")); + const moduleCallerMap = JSON.parse(core.getInput("module_callers") || "{}"); const changedWorkingDirs = new Set(); for (let i = 0; i < changedFiles.length; i++) { const changedFile = changedFiles[i]; diff --git a/list-targets/action.yaml b/list-targets/action.yaml index a2a45b842..cd67bca22 100644 --- a/list-targets/action.yaml +++ b/list-targets/action.yaml @@ -43,8 +43,11 @@ runs: shell: bash - uses: suzuki-shunsuke/tfaction/list-working-dirs@main id: list-working-directory-configs - - uses: suzuki-shunsuke/list-module-callers@main + - uses: suzuki-shunsuke/tfaction/get-global-config@main + id: global-config + - uses: suzuki-shunsuke/tfaction/list-module-callers@main id: list-module-callers + if: steps.global-config.outputs.disable_update_local_path_module_caller == 'false' with: config_files: ${{ steps.list-working-directory-configs.outputs.file }} module_files: ${{ steps.list-working-directory-configs.outputs.module_file }}