{"id":16639500,"url":"https://github.com/borchero/terraform-plan-comment","last_synced_at":"2025-04-05T23:06:20.937Z","repository":{"id":236820141,"uuid":"793190080","full_name":"borchero/terraform-plan-comment","owner":"borchero","description":"GitHub Action to post the output of \"terraform plan\" to a pull request comment.","archived":false,"fork":false,"pushed_at":"2025-03-13T22:54:52.000Z","size":1137,"stargazers_count":101,"open_issues_count":11,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T22:04:53.686Z","etag":null,"topics":["github-actions","terraform"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borchero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-28T17:19:50.000Z","updated_at":"2025-03-24T13:39:29.000Z","dependencies_parsed_at":"2024-06-02T22:10:35.484Z","dependency_job_id":"a9aef514-73a2-4f11-a7dd-a3aa9a79c891","html_url":"https://github.com/borchero/terraform-plan-comment","commit_stats":null,"previous_names":["borchero/terraform-plan-comment"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borchero%2Fterraform-plan-comment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borchero%2Fterraform-plan-comment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borchero%2Fterraform-plan-comment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borchero%2Fterraform-plan-comment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borchero","download_url":"https://codeload.github.com/borchero/terraform-plan-comment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411229,"owners_count":20934653,"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":["github-actions","terraform"],"created_at":"2024-10-12T07:06:16.737Z","updated_at":"2025-04-05T23:06:20.909Z","avatar_url":"https://github.com/borchero.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-plan-comment\n\nGitHub Action to post the output of `terraform plan` to a pull request comment.\n\n## Features\n\n- Generate a structured, \"markdown-native\" representation of the plan\n  - Obtain a high-level overview via foldable sections\n  - Do not lose _any_ information compared to the output of `terraform plan`\n- Post the plan to pull requests as a \"sticky comment\"\n- Run as a \"native\" JavaScript action rather than launching a Docker container\n- Use with or without the Terraform wrapper script provided by\n  [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform)\n\n## Usage\n\n```yaml\n- name: Setup terraform\n  uses: hashicorp/setup-terraform@v3\n- name: Initialize\n  run: terraform init\n- name: Plan\n  run: terraform plan -out .planfile\n- name: Post PR comment\n  uses: borchero/terraform-plan-comment@v2\n  with:\n    token: ${{ github.token }}\n    planfile: .planfile\n```\n\n### Example Comments\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eCollapsed\u003c/b\u003e\u003c/summary\u003e\n\n\u003cimg width=\"916\" alt=\"Screenshot 2024-04-30 at 00 07 36\" src=\"https://github.com/borchero/terraform-plan-comment/assets/22455425/b6d0e64c-1c9c-42b8-8060-c096922baa0a\"\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eExpanded\u003c/b\u003e\u003c/summary\u003e\n\n\u003cimg width=\"699\" alt=\"Screenshot 2024-04-30 at 00 08 22\" src=\"https://github.com/borchero/terraform-plan-comment/assets/22455425/c91c319a-276d-4d2d-98a7-52bd24b64d4c\"\u003e\n\n\u003c/details\u003e\n\n## Parameters\n\n```yaml\n- uses: borchero/terraform-plan-comment@v2\n  with:\n    # GitHub token for API access (Required)\n    token: \"\"\n\n    # Path to the Terraform plan file (Required)\n    planfile: \"\"\n\n    # Command to execute the Terraform binary\n    terraform-cmd: terraform\n\n    # Directory where Terraform should be called\n    working-directory: \".\"\n\n    # Header for the PR comment\n    header: 📝 Terraform Plan\n\n    # Skip comments for empty plans\n    skip-empty: false\n\n    # Skip PR comment creation entirely. When enabled, the plan will still be available in the step summary\n    skip-comment: false\n```\n\n### `token` (required)\n\nRequired input parameter to access the GitHub API for posting a pull request comment. Can be provided as\n`${{ github.token }}`, `${{ env.GITHUB_TOKEN }}` or some personal access token with appropriate permissions.\n\nIf using the workflow-provided token, make sure that your workflow/job has write-permissions to pull requests.\n\n### `planfile` (required)\n\nThe path to the planfile generated by `terraform plan` which holds the information about which changes ought to be\napplied.\n\n### `terraform-cmd`\n\nThe command to execute to call the Terraform binary. Defaults to `terraform`. You likely don't need to augment this\nunless `terraform` cannot be found in the `PATH`.\n\n### `working-directory`\n\nThe directory where the Terraform binary ought to be called. Defaults to `$GITHUB_WORKSPACE` and _must_ be specified if\n`terraform init` has been run in a different directory. Should be specified relative to `$GITHUB_WORKSPACE`.\n\n\u003c!-- prettier-ignore --\u003e\n\u003e [!IMPORTANT]\n\u003e `planfile` must be specified relative to the working directory.\n\n### `header`\n\nThe header that is used for the pull request comment posted by this action. Changing the default allows to distinguish\nmultiple Terraform runs: each sticky pull request comment is identified by its header.\n\n### `skip-empty`\n\nWhether to skip posting a pull request comment when no changes need to be performed. Defaults to `false`.\n\n### `skip-comment`\n\nWhether to skip posting a pull request comment entirely. When enabled, the plan will still be available in the step\nsummary.\n\n## Outputs\n\nThis action provides the following output:\n\n- `markdown`: The raw markdown output of the terraform plan\n- `empty`: Whether the terraform plan contains any change or not\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborchero%2Fterraform-plan-comment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborchero%2Fterraform-plan-comment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborchero%2Fterraform-plan-comment/lists"}