New to Kestra?
Use blueprints to kickstart your first workflows.
Check OpenTofu modules on every pull request with a Kestra webhook flow running tofu fmt and tofu validate, posting the verdict to Discord.
Module quality checks usually mean maintaining a CI runner with the right binary versions, and small teams often skip them entirely. This blueprint replaces that runner with a webhook-triggered Kestra flow. A pull request event hits the webhook URL, io.kestra.plugin.opentofu.cli.OpenTofuCLI loads the module tree from namespace files, tofu fmt -check -recursive rejects unformatted code, tofu validate rejects broken references and type errors, and Discord receives a pass or fail verdict with a link back to real logs.
on_module_change (io.kestra.plugin.core.trigger.Webhook) exposes a URL your Git provider calls on pull request events. The key is part of the URL, so replace the placeholder with a strong random value.check_module loads everything under modules/ from namespace files into the working directory, keeping the module source in Kestra's namespace file editor or synced there from Git.tofu fmt -check -recursive modules exits non-zero when any file needs reformatting, which fails the task and routes to the errors block.tofu init -backend=false installs the providers the module references without touching any state backend, then tofu validate checks the code structurally.report_success and report_failure post the two verdicts to Discord, each carrying the execution ID for the full log trail.A CI runner for two read-only commands is a lot of standing infrastructure. Kestra already has the execution engine, the container isolation, the webhook endpoint, and the notification plugins, so the check becomes twelve lines of flow YAML. The same namespace files that feed this check can feed the plan and apply flows, which means the code being checked is exactly the code being deployed.
modules/, added through the namespace file editor or synced from Git.-backend=false init and validate never touch real infrastructure.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.DISCORD_WEBHOOK_URL secret to your Kestra namespace.modules/main.tf in the namespace file editor with any valid OpenTofu code.key with a strong random value and point your Git provider's pull request webhook at the trigger URL.tofu test as a further command once your modules ship test files.