-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (44 loc) · 1.35 KB
/
terraform-github-import.yml
File metadata and controls
44 lines (44 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
name: Terraform GitHub Import
on:
workflow_dispatch:
inputs:
dry_run:
description: "Dry Run"
required: true
type: boolean
default: true
env:
TF_VAR_GITHUB_APP_PEM_FILE: ${{ secrets.TF_VAR_GITHUB_APP_PEM_FILE }}
jobs:
terraform-github-import:
name: Terraform GitHub Import
runs-on: ubuntu-latest
defaults:
run:
working-directory: "./terraform/github/"
steps:
- name: GitHub Checkout 🛎
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Python 🐍
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.10.4"
- name: Setup Terraform
uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
terraform_wrapper: false
- name: Terraform fmt
id: fmt
run: terraform fmt -check
- name: Terraform Init
id: init
run: terraform init
- name: Run import_resources [--dry-run]
id: dry-run
if: ${{inputs.dry_run == true}}
run: ./import_resources.py -n
- name: Run import_resources [--no-dry-run]
if: ${{inputs.dry_run == false}}
run: ./import_resources.py