{"id":20710874,"url":"https://github.com/entur/gha-terraform","last_synced_at":"2026-02-12T09:02:48.558Z","repository":{"id":258592439,"uuid":"786737994","full_name":"entur/gha-terraform","owner":"entur","description":"Repository with reusable workflows for terraform lint, plan and apply","archived":false,"fork":false,"pushed_at":"2026-02-02T14:11:10.000Z","size":1082,"stargazers_count":0,"open_issues_count":4,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-03T03:18:05.745Z","etag":null,"topics":["entur-reusable-workflows","ghas-ignore","github","golden-path","team-plattform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"eupl-1.2","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/entur.png","metadata":{"files":{"readme":".github/README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-15T07:58:24.000Z","updated_at":"2026-02-02T09:17:33.000Z","dependencies_parsed_at":"2024-11-05T12:33:32.775Z","dependency_job_id":"f66d32e5-fc3e-4f2e-81c9-9f54365bfa48","html_url":"https://github.com/entur/gha-terraform","commit_stats":null,"previous_names":["entur/gha-terraform"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/entur/gha-terraform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entur%2Fgha-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entur%2Fgha-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entur%2Fgha-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entur%2Fgha-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/entur","download_url":"https://codeload.github.com/entur/gha-terraform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entur%2Fgha-terraform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29362203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["entur-reusable-workflows","ghas-ignore","github","golden-path","team-plattform"],"created_at":"2024-11-17T02:13:25.434Z","updated_at":"2026-02-12T09:02:48.553Z","avatar_url":"https://github.com/entur.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n      \u003cbr\u003eentur/gha-terraform\u003cbr\u003e\n\u003c/h1\u003e\n\n[![Entur/Terraform/CI](https://github.com/entur/gha-terraform/actions/workflows/ci.yml/badge.svg?event=pull_request)](https://github.com/entur/gha-terraform/actions/workflows/ci.yml)\n\nGitHub Actions for working with Terraform\n\n- [Terraform lint](../README-lint.md)\n- [Terraform plan](../README-plan.md)\n- [Terraform apply](../README-apply.md)\n\n## Terraform version management\n\nThese reusable workflows will try to automatically determine the terraform version from your terraform code.\nYou can override this by setting the `version` input property.\n\n## Golden Path\n\n### Example\n\nLet's look at an example, assume our repo is called `amazing-app`:\n\n```sh\nλ amazing-app ❯ tree\n.\n├── README.md\n├── terraform\n│   ├── env\n│   │   ├──dev.tf\n│   │   ├──tst.tf\n│   │   └──prd.tf\n│   ├── backend.tf\n│   ├── main.tf\n│   ├── variables.tf\n│   └── versions.tf\n└── .github\n    └── workflows\n        ├── cd.yml\n        └── ci.yml\n```\n\n#### ci.yml\n\n```yaml\nname: CI\n\non:\n  pull_request:\n\njobs:\n  terraform-lint:\n    uses: entur/gha-terraform/.github/workflows/lint.yml@v2\n\n  terraform-plan:\n    uses: entur/gha-terraform/.github/workflows/plan.yml@v2\n```\n\n#### cd.yml\n\n```yaml\nname: CD\n\non:\n  pull_request:\n\njobs:\n  terraform-apply:\n    uses: entur/gha-terraform/.github/workflows/apply.yml@v2\n```\n\n#### Approval jobs\n\nIf you don't want to use a third party application to create an approval job before apply, you can use Github Environments. For inspiration: https://github.com/entur/thanos/blob/main/.github/workflows/deploy-to-all-envs.yml\n\n\n#### Conditional jobs\n\nIf you want to skip the terraform apply job when the terraform plan job has no changes, you can use `has_changes` output from the plan job as input to the apply job. In the apply job, add this: `has_changes: ${{ needs.\u003cTERRAFORM_PLAN_JOB_NAME\u003e.outputs.has_changes }}`. This will skip the apply job in GHA. To execute next job in the pipeline even if the apply job is skipped, you need to add following if statement in the next job as is: `if: ${{ always() \u0026\u0026 !cancelled() \u0026\u0026 !contains(needs.*.result, 'failure') }}`.\n\nExample:\n```yaml\n...\n  tf-plan-dev:\n    needs: terraform-lint\n    name: Terraform Plan DEV\n    uses: entur/gha-terraform/.github/workflows/plan.yml@v1\n    with:\n      environment: dev\n\n  tf-apply-dev:\n    needs: [tf-plan-dev]\n    name: Terraform Apply DEV\n    uses: entur/gha-terraform/.github/workflows/apply.yml@v1\n    with:\n      environment: dev\n      has_changes: ${{ needs.tf-plan-dev.outputs.has_changes }}\n\n  next-job-example:\n    needs: [tf-apply-dev]\n    if: ${{ always() \u0026\u0026 !cancelled() \u0026\u0026 !contains(needs.*.result, 'failure') }} \n    runs-on: ubuntu-latest\n    environment: Approve\n    steps:\n      - name: Manual approval\n        id: Approve\n        shell: bash\n        run: echo \"Approve the deployment\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentur%2Fgha-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fentur%2Fgha-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentur%2Fgha-terraform/lists"}