From 2e7963e81fef4e7ed144e399b737910e572da931 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Wed, 24 Dec 2025 13:02:36 +0800 Subject: [PATCH] Fix actionlint for GitOps repo input --- .../iac-pipeline-aws-global-account-matrix.yaml | 11 ++++++++++- .../workflows/iac-pipeline-aws-global-bootstrap.yaml | 11 ++++++++++- .../iac-pipeline-aws-global-landingzone-baseline.yaml | 11 ++++++++++- .../iac-pipeline-aws-global-resources-matrix.yaml | 11 ++++++++++- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/iac-pipeline-aws-global-account-matrix.yaml b/.github/workflows/iac-pipeline-aws-global-account-matrix.yaml index 120bce80..ffe256cc 100644 --- a/.github/workflows/iac-pipeline-aws-global-account-matrix.yaml +++ b/.github/workflows/iac-pipeline-aws-global-account-matrix.yaml @@ -51,10 +51,19 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Normalize GitOps repo + 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="${repo%.git}" + echo "repo=$repo" >> "$GITHUB_OUTPUT" + - name: Checkout GitOps config uses: actions/checkout@v4 with: - repository: ${{ replace(replace(github.event.inputs.gitops_repo_name || 'https://github.com/cloud-neutral-workshop/gitops.git', 'https://github.com/', ''), '.git', '') }} + repository: ${{ steps.gitops_repo.outputs.repo }} path: ${{ env.GITOPS_REPO_ROOT }} ref: ${{ github.event.inputs.gitops_repo_ref || 'main' }} diff --git a/.github/workflows/iac-pipeline-aws-global-bootstrap.yaml b/.github/workflows/iac-pipeline-aws-global-bootstrap.yaml index 264e8779..b530c5bc 100644 --- a/.github/workflows/iac-pipeline-aws-global-bootstrap.yaml +++ b/.github/workflows/iac-pipeline-aws-global-bootstrap.yaml @@ -44,10 +44,19 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Normalize GitOps repo + 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="${repo%.git}" + echo "repo=$repo" >> "$GITHUB_OUTPUT" + - name: Checkout GitOps config uses: actions/checkout@v4 with: - repository: ${{ replace(replace(github.event.inputs.gitops_repo_name || 'https://github.com/cloud-neutral-workshop/gitops.git', 'https://github.com/', ''), '.git', '') }} + repository: ${{ steps.gitops_repo.outputs.repo }} path: ${{ env.GITOPS_REPO_ROOT }} ref: ${{ github.event.inputs.gitops_repo_ref || 'main' }} diff --git a/.github/workflows/iac-pipeline-aws-global-landingzone-baseline.yaml b/.github/workflows/iac-pipeline-aws-global-landingzone-baseline.yaml index 7d15f8b2..ca50ed74 100644 --- a/.github/workflows/iac-pipeline-aws-global-landingzone-baseline.yaml +++ b/.github/workflows/iac-pipeline-aws-global-landingzone-baseline.yaml @@ -47,10 +47,19 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Normalize GitOps repo + 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="${repo%.git}" + echo "repo=$repo" >> "$GITHUB_OUTPUT" + - name: Checkout GitOps config uses: actions/checkout@v4 with: - repository: ${{ replace(replace(github.event.inputs.gitops_repo_name || 'https://github.com/cloud-neutral-workshop/gitops.git', 'https://github.com/', ''), '.git', '') }} + repository: ${{ steps.gitops_repo.outputs.repo }} path: ${{ env.GITOPS_REPO_ROOT }} ref: ${{ github.event.inputs.gitops_repo_ref || 'main' }} diff --git a/.github/workflows/iac-pipeline-aws-global-resources-matrix.yaml b/.github/workflows/iac-pipeline-aws-global-resources-matrix.yaml index 98d4c136..2db9c967 100644 --- a/.github/workflows/iac-pipeline-aws-global-resources-matrix.yaml +++ b/.github/workflows/iac-pipeline-aws-global-resources-matrix.yaml @@ -48,10 +48,19 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Normalize GitOps repo + 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="${repo%.git}" + echo "repo=$repo" >> "$GITHUB_OUTPUT" + - name: Checkout GitOps config uses: actions/checkout@v4 with: - repository: ${{ replace(replace(github.event.inputs.gitops_repo_name || 'https://github.com/cloud-neutral-workshop/gitops.git', 'https://github.com/', ''), '.git', '') }} + repository: ${{ steps.gitops_repo.outputs.repo }} path: ${{ env.GITOPS_REPO_ROOT }} ref: ${{ github.event.inputs.gitops_repo_ref || 'main' }}