https://github.com/suzuki-shunsuke/github-action-terraform-init
GitHub Actions to run terraform init
https://github.com/suzuki-shunsuke/github-action-terraform-init
Last synced: about 2 months ago
JSON representation
GitHub Actions to run terraform init
- Host: GitHub
- URL: https://github.com/suzuki-shunsuke/github-action-terraform-init
- Owner: suzuki-shunsuke
- License: mit
- Created: 2021-10-11T01:51:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-17T22:09:50.000Z (10 months ago)
- Last Synced: 2025-02-27T04:25:25.046Z (2 months ago)
- Language: Shell
- Size: 15.6 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-action-terraform-init
GitHub Actions to run `terraform init` and `terraform providers lock`.
If Terraform lock file `.terraform.lock.hcl` is created or updated, this action pushes a commit to the remote branch `GITHUB_HEAD_REF`.
--
## Requirements
- terraform
- [github-comment](https://github.com/suzuki-shunsuke/github-comment)
- [ghcp](https://github.com/int128/ghcp)## Example
```yaml
- uses: suzuki-shunsuke/github-action-terraform-init@main
with:
github_app_token: ${{ secrets.GITHUB_APP_TOKEN }}
``````yaml
- uses: suzuki-shunsuke/github-action-terraform-init@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_app_token: ${{ secrets.GITHUB_APP_TOKEN }}
working_directory: foo
skip_push: "true"
terraform_command: tofu
```## Inputs
### Required Inputs
name | description
--- | ---
github_app_token | GitHub Access Token. This is used to push a commit to the remote branch### Optional Inputs
name | default | description
--- | --- | ---
github_token | `github.token` | GitHub Access Token. This is used to notify the failure with github-comment
working_directory | "" (current directory) | Working Directory path
providers_lock_opts | `-platform=windows_amd64 -platform=linux_amd64 -platform=darwin_amd64` | [terraform providers lock](https://www.terraform.io/cli/commands/providers/lock) options
skip_push | "" | If "true", a commit isn't pushed to the remote branch
terraform_command | terraform | You can execute a tool such as OpenTofu instead of Terraform## Outputs
Nothing.
## License
[MIT](LICENSE)