Skip to content

Commit

Permalink
fix(actions, docs): Fixing action to be action - not workflow syntax,…
Browse files Browse the repository at this point in the history
… improving docs, removing versioning as this is done via setup
  • Loading branch information
Tristan Watson committed Aug 8, 2024
1 parent 7762ea1 commit 53266c7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows → .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
# oak-terraform-actions

The `actions` folder is designed to house reusable GitHub Actions, making it easy to manage and share automation across different repositories. Each subfolder within `actions` contains a specific action with all necessary files and documentation.
The `actions` folder is designed to house reusable GitHub Actions for **Terraform**, making it easy to manage and share automation across different repositories. See the Example folder to get started.

#### Structure

```plaintext
actions/
├── terraform/
├── terraform-checks/
│ ├── action.yml
│ ├── scripts/ (if any)
│ └── README.md
```

### Terraform Actions 🌍

**Location:** `actions/terraform`
#### Terraform Checks

**Purpose:** The Terraform action automates Terraform workflows, including applying infrastructure as code configurations.
**Location:** `actions/terraform-checks`

**Purpose:** The Terraform Github Action checks your code fits the Oak standards.

#### Key Features

- **Infrastructure Management:** Streamlines Terraform commands in CI/CD pipelines.
- **Ease of Use:** Integrates seamlessly with your GitHub workflows.
- **Customizable:** Accepts input parameters for flexible operation.

### How to Use

```yaml
name: Terraform Check
# Example Github Workflow file to run Terraform Check action
name: Terraform Checks

on: [push, pull_request]

Expand All @@ -36,8 +38,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Terraform Action from oak-terraform-actions
uses: oaknational/oak-terraform-actions/actions/terraform@main
uses: oaknational/oak-terrform-actions/actions/terraform-checks@main
```
For more details, visit the [Oak Terraform Actions repository](https://github.com/oaknational/oak-terraform-actions).
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
name: "Terraform Checks"

Check warning on line 1 in actions/terraform-checks/action.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

1:1 [document-start] missing document start "---"

Check warning on line 1 in actions/terraform-checks/action.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

1:1 [document-start] missing document start "---"
description: "Perform common Terraform checks"
inputs:
terraform_version:
description: "Terraform version to use"
required: false
default: "1.5.7"

runs:
using: "composite"
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ inputs.terraform_version }}

Expand Down
12 changes: 0 additions & 12 deletions examples/define-version/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/general-use/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Run Terraform Action from oak-terraform-actions
uses: oaknational/oak-terraform-actions/actions/terraform@main
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Terraform Check
# Example Github Workflow file to run Terraform Check action
name: Terraform Checks

Check warning on line 2 in examples/general-use/terraform-checks.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

2:1 [document-start] missing document start "---"

Check warning on line 2 in examples/general-use/terraform-checks.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

2:1 [document-start] missing document start "---"

on: [push, pull_request]

Check warning on line 4 in examples/general-use/terraform-checks.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

4:1 [truthy] truthy value should be one of [false, true]

Check warning on line 4 in examples/general-use/terraform-checks.yml

View workflow job for this annotation

GitHub Actions / lint-yaml

4:1 [truthy] truthy value should be one of [false, true]

Expand All @@ -7,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Terraform Action from oak-terraform-actions
uses: oaknational/oak-terrform-actions/actions/terraform@main
with:
example_input: "value"
uses: oaknational/oak-terrform-actions/actions/terraform-checks@main

0 comments on commit 53266c7

Please sign in to comment.