From c3dcbd5a716a1b1074d6524d7082757d395018cb Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Fri, 2 Jan 2026 11:10:06 +0800 Subject: [PATCH] Update workflows --- .../iac-pipeline-mutli-cloud-account-matrix.yaml | 15 +++++++++++++-- ...ml => iac-pipeline-mutli-cloud-bootstrap.yaml} | 8 ++++---- ...pipeline-mutli-cloud-landingzone-baseline.yaml | 15 +++++++++++++-- ...iac-pipeline-mutli-cloud-resources-matrix.yaml | 15 +++++++++++++-- .gitignore | 1 + 5 files changed, 44 insertions(+), 10 deletions(-) rename .github/workflows/{iac-pipeline-mutli-cloud-bootstrap..yaml => iac-pipeline-mutli-cloud-bootstrap.yaml} (90%) diff --git a/.github/workflows/iac-pipeline-mutli-cloud-account-matrix.yaml b/.github/workflows/iac-pipeline-mutli-cloud-account-matrix.yaml index 2e64287a..abc28178 100644 --- a/.github/workflows/iac-pipeline-mutli-cloud-account-matrix.yaml +++ b/.github/workflows/iac-pipeline-mutli-cloud-account-matrix.yaml @@ -54,9 +54,20 @@ jobs: id: gitops_repo shell: bash run: | - repo_input="${{ github.event.inputs.gitops_repo_name || 'https://github.com/cloud-neutral-workshop/gitops.git' }}" - repo="${repo_input#https://github.com/}" + repo_input="${{ github.event.inputs.gitops_repo_name }}" + if [ -z "$repo_input" ]; then + repo_input="https://github.com/cloud-neutral-workshop/gitops.git" + fi + case "$repo_input" in + https://github.com/*) repo="${repo_input#https://github.com/}" ;; + git@github.com:*) repo="${repo_input#git@github.com:}" ;; + *) repo="$repo_input" ;; + esac repo="${repo%.git}" + if [ -z "$repo" ]; then + echo "GitOps repo is empty after normalization." >&2 + exit 1 + fi echo "repo=$repo" >> "$GITHUB_OUTPUT" - name: Checkout GitOps config diff --git a/.github/workflows/iac-pipeline-mutli-cloud-bootstrap..yaml b/.github/workflows/iac-pipeline-mutli-cloud-bootstrap.yaml similarity index 90% rename from .github/workflows/iac-pipeline-mutli-cloud-bootstrap..yaml rename to .github/workflows/iac-pipeline-mutli-cloud-bootstrap.yaml index 3e75812d..7b503306 100644 --- a/.github/workflows/iac-pipeline-mutli-cloud-bootstrap..yaml +++ b/.github/workflows/iac-pipeline-mutli-cloud-bootstrap.yaml @@ -35,11 +35,11 @@ on: env: TG_VERSION: 0.67.14 - TG_ROOT: ${{ github.event.inputs.bootstrap_cloud }} - GITOPS_REPO: ${{ github.event.inputs.gitops_repo_name }} + TG_ROOT: ${{ github.event.inputs.bootstrap_cloud || 'terraform-hcl-standard/aws-cloud/bootstrap' }} + GITOPS_REPO: ${{ github.event.inputs.gitops_repo_name || 'https://github.com/cloud-neutral-workshop/gitops.git' }} DEPLOY_ACTION: ${{ github.event.inputs.deploy_action || 'plan' }} - BOOTSTRAP_CONFIG_FILE: ${{ github.event.inputs.gitops_bootstrap_config }} - BOOTSTRAP_CONFIG_PATH: terraform-hcl-standard/aws-cloud/bootstrap/gitops/${{ github.event.inputs.gitops_bootstrap_config }} + BOOTSTRAP_CONFIG_FILE: ${{ github.event.inputs.gitops_bootstrap_config || 'config/xzerolab/sit/aws-cloud/account/bootstrap.yaml' }} + BOOTSTRAP_CONFIG_PATH: terraform-hcl-standard/aws-cloud/bootstrap/gitops/${{ github.event.inputs.gitops_bootstrap_config || 'config/xzerolab/sit/aws-cloud/account/bootstrap.yaml' }} jobs: bootstrap: diff --git a/.github/workflows/iac-pipeline-mutli-cloud-landingzone-baseline.yaml b/.github/workflows/iac-pipeline-mutli-cloud-landingzone-baseline.yaml index 0f8ba6c6..0fb6035c 100644 --- a/.github/workflows/iac-pipeline-mutli-cloud-landingzone-baseline.yaml +++ b/.github/workflows/iac-pipeline-mutli-cloud-landingzone-baseline.yaml @@ -50,9 +50,20 @@ jobs: id: gitops_repo shell: bash run: | - repo_input="${{ github.event.inputs.gitops_repo_name || 'https://github.com/cloud-neutral-workshop/gitops.git' }}" - repo="${repo_input#https://github.com/}" + repo_input="${{ github.event.inputs.gitops_repo_name }}" + if [ -z "$repo_input" ]; then + repo_input="https://github.com/cloud-neutral-workshop/gitops.git" + fi + case "$repo_input" in + https://github.com/*) repo="${repo_input#https://github.com/}" ;; + git@github.com:*) repo="${repo_input#git@github.com:}" ;; + *) repo="$repo_input" ;; + esac repo="${repo%.git}" + if [ -z "$repo" ]; then + echo "GitOps repo is empty after normalization." >&2 + exit 1 + fi echo "repo=$repo" >> "$GITHUB_OUTPUT" - name: Checkout GitOps config diff --git a/.github/workflows/iac-pipeline-mutli-cloud-resources-matrix.yaml b/.github/workflows/iac-pipeline-mutli-cloud-resources-matrix.yaml index 2369b914..1c0108d8 100644 --- a/.github/workflows/iac-pipeline-mutli-cloud-resources-matrix.yaml +++ b/.github/workflows/iac-pipeline-mutli-cloud-resources-matrix.yaml @@ -52,9 +52,20 @@ jobs: id: gitops_repo shell: bash run: | - repo_input="${{ github.event.inputs.gitops_repo_name || 'https://github.com/cloud-neutral-workshop/gitops.git' }}" - repo="${repo_input#https://github.com/}" + repo_input="${{ github.event.inputs.gitops_repo_name }}" + if [ -z "$repo_input" ]; then + repo_input="https://github.com/cloud-neutral-workshop/gitops.git" + fi + case "$repo_input" in + https://github.com/*) repo="${repo_input#https://github.com/}" ;; + git@github.com:*) repo="${repo_input#git@github.com:}" ;; + *) repo="$repo_input" ;; + esac repo="${repo%.git}" + if [ -z "$repo" ]; then + echo "GitOps repo is empty after normalization." >&2 + exit 1 + fi echo "repo=$repo" >> "$GITHUB_OUTPUT" - name: Checkout GitOps config diff --git a/.gitignore b/.gitignore index fefc1eb0..4c09a0b8 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,4 @@ hosts/inventory offline-iac/ offline-setup-*.tar.gz +.env