Skip to content

Commit

Permalink
docs: standardize README documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed Mar 26, 2025
1 parent d9b3cff commit e686fba
Showing 1 changed file with 6 additions and 52 deletions.
58 changes: 6 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# terraform-validate

A GitHub composite action that runs `terraform validate` on a workspace after initializing it.

## Description

The `terraform-validate` action automates the validation of Terraform configurations by running `terraform init` followed by `terraform validate`. It handles backend configuration and variable files, making it easy to validate Terraform code in your CI/CD pipelines.

## Features

- Automatically runs `terraform init` before validation
- Supports custom working directories
- Handles backend configuration variables
Expand All @@ -17,64 +13,22 @@ The `terraform-validate` action automates the validation of Terraform configurat

## Inputs

| Name | Description | Required | Default |
|------|-------------|----------|---------|
| `working-directory` | Directory containing Terraform configuration files | false | `.` |
| `backend-config` | Backend configuration variables, one per line | false | N/A |
| `var-file` | Path to a Terraform tfvars file | false | N/A |
This action has no inputs.

## Outputs

| Name | Description |
|------|-------------|
| `is_valid` | Whether the Terraform configuration is valid (true/false) |
| `stdout` | Output from terraform validate command |
| `stderr` | Any error output from terraform validate command |
| `is_valid` | No description provided |
| `description` | No description provided |
| `stdout` | No description provided |
| `stderr` | No description provided |

## Usage Examples

### Basic Validation

```yaml
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3

- name: Validate Terraform Configuration
uses: CSVD/terraform-validate@v1
with:
working-directory: './terraform'
```
### With Backend Configuration
```yaml
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3

- name: Validate Terraform Configuration
uses: CSVD/terraform-validate@v1
with:
working-directory: './terraform'
backend-config: |
bucket=my-terraform-state
key=prod/terraform.tfstate
region=us-east-1
```

## Requirements
- Terraform must be installed in the runner environment (typically using `hashicorp/setup-terraform` action)
- Repository must be checked out before running this action
- Appropriate AWS credentials if using remote state in S3 (or similar backend configuration)

0 comments on commit e686fba

Please sign in to comment.