Import By Config File #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Import Config From File | |
on: | |
workflow_dispatch: | |
inputs: | |
config_out_fn: | |
type: string | |
default: "out.tf" | |
jobs: | |
importer: | |
name: "Import-Run" | |
runs-on: ubuntu-latest | |
environment: importer-lbgsandbox | |
container: | |
image: ghcr.io/${{ github.repository }}/python_tf:latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
JP_TENANT_NAME: ${{ vars.JP_TENANT_NAME }} | |
JP_CLIENT_ID: ${{ secrets.JP_CLIENT_ID }} | |
JP_CLIENT_SECRET: ${{ secrets.JP_CLIENT_SECRET }} | |
WORKING_DIR: ${{ vars.WORKING_DIR }} | |
steps: | |
- name: "Checkout" | |
uses: actions/[email protected] | |
- name: Run Python script | |
run: python scripts/import_via_config_file.py | |
- name: Terraform | |
run: | | |
cd importer_working_dir/ | |
terraform init | |
terraform fmt | |
terraform plan --generate-config-out="${{ inputs.config_out_fn }}" | |
- name: Commit back to Repo | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Github Action" | |
git add importer_working_dir/ | |
git commit -m "Uploading output files" | |
git push | |