CtrlK
BlogDocsLog inGet started
Tessl Logo

nitinjain999/platform-skills

Production-grade platform engineering handbook — Kubernetes, Terraform, Flux CD, GitHub Actions, AWS, and more.

67

Quality

84%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

README.mdexamples/github-actions/composite-actions/terraform-plan/

terraform-plan

Run terraform fmt → validate → plan and post the plan output as an idempotent PR comment. Supports AWS and Azure OIDC — no static cloud credentials required.

Status: Stable

Quick start

- uses: your-org/actions/terraform-plan@v1
  with:
    working_directory: terraform/environments/production
    github_token: ${{ secrets.GITHUB_TOKEN }}
    aws_role_arn: arn:aws:iam::123456789012:role/terraform-plan

Inputs

InputTypeRequiredSecretDefaultDescription
working_directorystringYesNoTerraform root module directory
terraform_versionstringNoNo1.9.0Terraform version to install
github_tokenstringYesYesToken for posting PR comment
aws_role_arnstringNoNo''AWS IAM role ARN for OIDC
aws_regionstringNoNous-east-1AWS region
azure_client_idstringNoNo''Azure app client ID for OIDC
azure_tenant_idstringNoNo''Azure tenant ID
azure_subscription_idstringNoNo''Azure subscription ID
var_filestringNoNo''Path to .tfvars file
comment_on_prbooleanNoNotruePost plan as PR comment

Outputs

OutputDescription
plan_exitcode0 = no changes, 2 = changes present
has_changestrue if the plan contains infrastructure changes

Variables and secrets

secrets.GITHUB_TOKEN ──► inputs.github_token ──► ::add-mask:: ──► github-script token
secrets.* (none)        OIDC-based cloud auth — no static credentials stored

Cloud auth flow (AWS example):
  id-token: write permission on caller job
        │
        ▼
  GitHub OIDC provider issues JWT
        │
        ▼
  aws-actions/configure-aws-credentials assumes inputs.aws_role_arn
        │  (role ARN is a plain variable — not a secret)
        ▼
  Short-lived AWS credentials in environment
        │
        ▼
  terraform plan  (reads AWS_ACCESS_KEY_ID etc. from environment — never in logs)

What is logged vs what is masked:

ValueLogged?
working_directory✅ Yes
aws_role_arn✅ Yes — not a secret, is a resource identifier
github_token❌ No — masked immediately
AWS temporary credentials❌ No — managed by aws-actions, never echoed
terraform plan output✅ Yes — shown in PR comment and job summary

Permissions

permissions:
  contents: read
  pull-requests: write   # post plan comment
  id-token: write        # OIDC for AWS/Azure

Idempotency

Idempotent — the PR comment uses a hidden marker <!-- terraform-plan:<directory> --> so re-running the workflow updates the existing comment rather than creating a duplicate.


Concurrency (recommended)

concurrency:
  group: terraform-plan-${{ github.ref }}
  cancel-in-progress: true

Full example

name: Terraform plan

on:
  pull_request:
    paths:
      - 'terraform/**'

permissions:
  contents: read
  pull-requests: write
  id-token: write

jobs:
  plan:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4.2.2

      - uses: your-org/actions/terraform-plan@v1
        with:
          working_directory: terraform/environments/production
          github_token: ${{ secrets.GITHUB_TOKEN }}
          aws_role_arn: ${{ vars.AWS_PLAN_ROLE_ARN }}
          aws_region: us-east-1
          var_file: environments/production.tfvars

Changelog

See CHANGELOG.md

examples

BEFORE_AFTER.md

CHANGELOG.md

CODE_OF_CONDUCT.md

COMMANDS.md

CONTRIBUTING.md

EDITOR_INTEGRATIONS.md

GETTING_STARTED.md

HOW_IT_WORKS.md

install.sh

INSTALLATION.md

LAUNCH.md

PROMPTS.md

QUICKSTART.md

README.md

renovate.json

SECURITY.md

SKILL.md

tessl.json

tile.json