{"id":21664402,"url":"https://github.com/wayofdev/gh-action-terragrunt-plan","last_synced_at":"2026-05-16T20:36:17.096Z","repository":{"id":208413828,"uuid":"718336001","full_name":"wayofdev/gh-action-terragrunt-plan","owner":"wayofdev","description":"Github Action to generate a Terraform plan using Terragrunt plan-all.","archived":false,"fork":false,"pushed_at":"2024-01-08T12:07:46.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-25T07:42:11.958Z","etag":null,"topics":["actions","github-action","github-actions","terraform","terragrunt","wayofdev","wod"],"latest_commit_sha":null,"homepage":"https://wayof.dev","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wayofdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"wayofdev"}},"created_at":"2023-11-13T21:48:37.000Z","updated_at":"2024-09-19T16:21:04.000Z","dependencies_parsed_at":"2024-01-08T13:36:47.458Z","dependency_job_id":"fc81e4d3-2ed8-4299-a4f0-1fb8db057f56","html_url":"https://github.com/wayofdev/gh-action-terragrunt-plan","commit_stats":null,"previous_names":["wayofdev/gh-action-terragrunt-plan"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fgh-action-terragrunt-plan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fgh-action-terragrunt-plan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fgh-action-terragrunt-plan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fgh-action-terragrunt-plan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wayofdev","download_url":"https://codeload.github.com/wayofdev/gh-action-terragrunt-plan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244560392,"owners_count":20472220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","github-action","github-actions","terraform","terragrunt","wayofdev","wod"],"created_at":"2024-11-25T10:37:24.641Z","updated_at":"2026-05-16T20:36:12.075Z","avatar_url":"https://github.com/wayofdev.png","language":null,"funding_links":["https://github.com/sponsors/wayofdev"],"categories":[],"sub_categories":[],"readme":"# gh-action-terragrunt-plan action\n\nThis Terragrunt action based on [dflook/terraform-github-actions](https://github.com/dflook/terraform-github-actions).\n\nThis actions generates a Terraform plan for each module in the provided path.\nIf the triggering event relates to a PR it will add a comment on the PR containing the generated plans.\n\n\nThe `GITHUB_TOKEN` environment variable must be set for the PR comment to be added.\nThe action can be run on other events, which prints the plan to the workflow log.\n\n**NOTE:** This github action uses default terragrunt cache folder `.terragrunt-cache` to create plan and then to read it. \nDon't use terragrunt_download setting in your terragrunt code and also don't clear cache. Otherwise the action won't work.\n\n## Inputs\n\n* `path`\n\n  Path to the Terraform root module to apply\n\n  - Type: string\n  - Optional\n  - Default: The action workspace\n\n* `tg_version`\n\n  Terragrunt version required to run the plan\n\n  - Type: string\n  - Optional\n  - Default: `0.52.4`\n\n* `tf_version`\n\n  Terraform version required to run the plan\n\n  - Type: string\n  - Optional\n  - Default: `1.5.7`\n\n* `parallelism`\n\n  Limit the number of concurrent operations\n\n  - Type: number\n  - Optional\n  - Default: The terraform default (10)\n\n* `label`\n\n  A friendly name for the environment the Terraform configuration is for.\n  This will be used in the PR comment for easy identification.\n\n  If set, must be the same as the `label` used in the corresponding `terraform-apply` command.\n\n  - Type: string\n  - Optional\n\n* `add_github_comment`\n\n  The default is `true`, which adds a comment to the PR with the results of the plan.\n  Set to `changes-only` to add a comment only when the plan indicates there are changes to apply.\n  Set to `false` to disable the comment - the plan will still appear in the workflow log.\n\n  - Type: string\n  - Optional\n  - Default: true\n\n* `destroy`\n\n  Set to true to generate a plan to destroy all resources.\n\n  This generates a plan in destroy mode.\n\n  - Type: boolean\n  - Optional\n  - Default: false\n\n* `create_cache_folder_in_workspace`\n\n  Set to true to create a cache folder in workspace. It can be reused in other steps, jobs and workflows. By default it created in /tmp folder inside docker container and not available outside.\n\n  - Type: boolean\n  - Optional\n  - Default: false\n\n* `cache_folder`\n\n  Specify custom name for the cache folder which will be created in github workspace. Two additional folders will be created inside  `cache_folder`: `tf_plugin_cache_folder` and `tg_cache_folder`\n\n  - Type: string\n  - Optional\n  - Default: .terragrunt-cache\n\n* `use_tf_plugin_cache_folder`\n\n  If set to `true`, the varibale TF_PLUGIN_CACHE_DIR will be enabled. Sometimes there can be problems when using these variable in Terragrunt\n\n  - Type: boolean\n  - Optional\n  - Default: false\n\n* `tf_plugin_cache_folder`\n\n  Specify custom name for the tf_plugin_cache_folder folder which will be created inside `cache_folder`. Variable TF_PLUGIN_CACHE_DIR will be set to `${GITHUB_WORKSPACE}/${cache_folder}/${tf_plugin_cache_folder}`. Only applicable if `use_tf_plugin_cache_folder` is set to true\n\n  - Type: string\n  - Optional\n  - Default: tf-plugin-cache\n\n* `tg_cache_folder`\n\n  Specify custom name for the tg_cache_folder folder which will be created inside `cache_folder`. Terragrunt commands will be executed with option `--terragrunt-download-dir ${GITHUB_WORKSPACE}/${cache_folder}/${tg_cache_folder}`\n\n  - Type: string\n  - Optional\n  - Default: tg-cache\n\n## Environment Variables\n\n* `GITHUB_TOKEN`\n\n  The GitHub authorization token to use to create comments on a PR.\n  The token provided by GitHub Actions can be used - it can be passed by\n  using the `${{ secrets.GITHUB_TOKEN }}` expression, e.g.\n\n  ```yaml\n  env:\n    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n  ```\n\n  The token provided by GitHub Actions has default permissions at GitHub's whim. You can see what it is for your repo under the repo settings.\n\n  The minimum permissions are `pull-requests: write`.\n  It will also likely need `contents: read` so the job can checkout the repo.\n\n  You can also use any other App token that has `pull-requests: write` permission.\n\n  You can use a fine-grained Personal Access Token which has repository permissions:\n  - Read access to metadata\n  - Read and Write access to pull requests\n\n  You can also use a classic Personal Access Token which has the `repo` scope.\n\n  The GitHub user or app that owns the token will be the PR comment author.\n\n  - Type: string\n  - Optional\n\n* `TERRAFORM_ACTIONS_GITHUB_TOKEN`\n\n  When this is set it is used instead of `GITHUB_TOKEN`, with the same behaviour.\n  The GitHub Terraform provider also uses the `GITHUB_TOKEN` environment variable, \n  so this can be used to make the github actions and the Terraform provider use different tokens.\n\n  - Type: string\n  - Optional\n\n## Workflow events\n\nWhen adding the plan to a PR comment (`add_github_comment` is set to `true`/`changes-only`), the workflow can be triggered by the following events:\n\n  - pull_request\n  - pull_request_review_comment\n  - pull_request_target\n  - pull_request_review\n  - issue_comment, if the comment is on a PR (see below)\n  - push, if the pushed commit came from a PR (see below)\n  - repository_dispatch, if the client payload includes the pull_request url (see below)\n\nWhen `add_github_comment` is set to `false`, the workflow can be triggered by any event.\n\n### issue_comment\n\nThis event triggers workflows when a comment is made in a Issue, as well as a Pull Request.\nSince running the action will only work in the context of a PR, the workflow should check that the comment is on a PR before running.\n\nAlso take care to checkout the PR ref.\n\n```yaml\njobs:\n  plan:\n    if: ${{ github.event.issue.pull_request }}\n    runs-on: ubuntu-latest\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n        with:\n          ref: refs/pull/${{ github.event.issue.number }}/merge\n\n      - name: terragrung plan\n        uses: wayofdev/gh-action-terragrunt-plan@v1\n        with:\n          path: my-terraform-config\n```\n\n### push\n\nThe pushed commit must have come from a Pull Request. Typically this is used to trigger a workflow that runs on the main branch after a PR has been merged.\n\n### repository_dispatch\n\nThis event can be used to trigger a workflow from another workflow. The client payload must include the pull_request api url of where the plan PR comment should be added.\n\nA minimal example payload looks like:\n```json\n{\n  \"pull_request\": {\n    \"url\": \"https://api.github.com/repos/wayofdev/gh-actions-terragrunt/pulls/1\"\n  }\n}\n```\n\n## Example usage\n\n### Automatically generating a plan\n\nThis example workflow runs on every push to an open pull request,\nand create or updates a comment with the terraform plan\n\n```yaml\nname: PR Plan\n\non: [pull_request]\n\npermissions:\n  contents: read\n  pull-requests: write\n\njobs:\n  plan:\n    runs-on: ubuntu-latest\n    name: Create terraform plan\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}            \n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: terragrunt plan\n        uses: wayofdev/gh-action-terragrunt-plan@v1\n        with:\n          path: my-terraform-config\n```\n\n### Generating a plan using a comment\n\nThis workflow generates a plan on demand, triggered by someone\ncommenting `terraform plan` on the PR. The action will create or update\na comment on the PR with the generated plan.\n\n```yaml\nname: Terraform Plan\n\non: [issue_comment]\n\npermissions:\n  contents: read\n  pull-requests: write\n\njobs:\n  plan:\n    if: ${{ github.event.issue.pull_request \u0026\u0026 contains(github.event.comment.body, 'terraform plan') }}\n    runs-on: ubuntu-latest\n    name: Create Terraform plan\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n        with:\n          ref: refs/pull/${{ github.event.issue.number }}/merge\n\n      - name: terraform plan\n        uses: wayofdev/gh-action-terragrunt-plan@v.0.0.2\n        with:\n          path: my-terraform-config\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayofdev%2Fgh-action-terragrunt-plan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwayofdev%2Fgh-action-terragrunt-plan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayofdev%2Fgh-action-terragrunt-plan/lists"}