diff --git a/content/source/docs/github-actions/getting-started/index.html.md b/content/source/docs/github-actions/getting-started/index.html.md index 314c67fff9..51a3ae5ebc 100644 --- a/content/source/docs/github-actions/getting-started/index.html.md +++ b/content/source/docs/github-actions/getting-started/index.html.md @@ -31,54 +31,39 @@ Terraform's GitHub Actions on new and updated pull requests. 1. Replace the default workflow with the following: - ```hcl - workflow "Terraform" { - resolves = "terraform-plan" - on = "pull_request" - } - - action "filter-to-pr-open-synced" { - uses = "actions/bin/filter@master" - args = "action 'opened|synchronize'" - } - - action "terraform-fmt" { - uses = "hashicorp/terraform-github-actions/fmt@v" - needs = "filter-to-pr-open-synced" - secrets = ["GITHUB_TOKEN"] - env = { - TF_ACTION_WORKING_DIR = "." - } - } - - action "terraform-init" { - uses = "hashicorp/terraform-github-actions/init@v" - needs = "terraform-fmt" - secrets = ["GITHUB_TOKEN"] - env = { - TF_ACTION_WORKING_DIR = "." - } - } - - action "terraform-validate" { - uses = "hashicorp/terraform-github-actions/validate@v" - needs = "terraform-init" - secrets = ["GITHUB_TOKEN"] - env = { - TF_ACTION_WORKING_DIR = "." - } - } - - action "terraform-plan" { - uses = "hashicorp/terraform-github-actions/plan@v" - needs = "terraform-validate" - secrets = ["GITHUB_TOKEN"] - env = { - TF_ACTION_WORKING_DIR = "." - # If you're using Terraform workspaces, set this to the workspace name. - TF_ACTION_WORKSPACE = "default" - } - } + ```yaml + on: pull_request + name: Terraform + jobs: + filter-to-pr-open-synced: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: filter-to-pr-open-synced + uses: actions/bin/filter@master + with: + args: action 'opened|synchronize' + - name: terraform-fmt + uses: hashicorp/terraform-github-actions/fmt@v + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TF_ACTION_WORKING_DIR: . + - name: terraform-init + uses: hashicorp/terraform-github-actions/init@v + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TF_ACTION_WORKING_DIR: . + - name: terraform-validate + uses: hashicorp/terraform-github-actions/validate@v + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TF_ACTION_WORKING_DIR: . + - name: terraform-plan + uses: hashicorp/terraform-github-actions/plan@v + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TF_ACTION_WORKING_DIR: . + TF_ACTION_WORKSPACE: default ``` 1. Find the latest version from [https://github.com/hashicorp/terraform-github-actions/releases](https://github.com/hashicorp/terraform-github-actions/releases) and replace all instances of `@v`. For example: `uses = "hashicorp/terraform-github-actions/plan@v3.0"`.