diff --git a/.github/workflows/update-helm-depends.yaml b/.github/workflows/update-helm-depends.yaml index 24dd908..9c32776 100644 --- a/.github/workflows/update-helm-depends.yaml +++ b/.github/workflows/update-helm-depends.yaml @@ -11,7 +11,7 @@ on: options: - argocd - forgejo - - nginx + - ingress-nginx tag: description: 'Tag (e.g. v11.0.5)' required: true @@ -22,10 +22,24 @@ jobs: runs-on: docker steps: + - name: Repository meta + id: repository + run: | + registry=${{ github.server_url }} + registry=${registry##http*://} + echo "registry=${registry}" >> "$GITHUB_OUTPUT" + echo "registry=${registry}" + repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" + echo "repository=${repository}" >> "$GITHUB_OUTPUT" + echo "repository=${repository}" + organization="$(echo "${{ github.repository }}" | sed 's|/.*||')" + echo "organization=${organization}" >> "$GITHUB_OUTPUT" + echo "organization=${organization}" + - name: Checkout helm repo uses: actions/checkout@v4 with: - repository: DevFW-CICD/${{ inputs.helmRepo }}-helm + repository: ${{ steps.repository.outputs.organization }}/${{ inputs.helmRepo }}-helm token: ${{ secrets.PAT }} ref: main path: helmworkspace @@ -40,15 +54,22 @@ jobs: git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git remote add upstream https://code.forgejo.org/forgejo-helm/forgejo-helm.git + if [[ "${{ inputs.helmRepo }}" == "argocd" ]]; then + git remote add upstream https://github.com/argoproj/argo-helm + elif [[ "${{ inputs.helmRepo }}" == "forgejo" ]]; then + git remote add upstream https://code.forgejo.org/forgejo-helm/forgejo-helm.git + elif [[ "${{ inputs.helmRepo }}" == "ingress-nginx" ]]; then + git remote add upstream https://github.com/kubernetes/ingress-nginx + else + echo unknown option helmRepo ${{ inputs.helmRepo }} + exit 1 + fi git fetch --all git checkout upstream/main git checkout main git merge upstream/main || true git commit || true - echo hier - git push origin ${{ inputs.tag }} git checkout ${{ inputs.tag }} @@ -65,13 +86,22 @@ jobs: mv linux-arm64/helm ../helm rm -Rf linux-arm64 helm-v3.16.2-linux-arm64.tar.gz fi - ../helm dependency update . - ../helm dependency build . - git status + + if [[ "${{ inputs.helmRepo }}" == "argocd" ]]; then + ../helm dependency update ./charts/argo-cd + ../helm dependency build ./charts/argo-cd + elif [[ "${{ inputs.helmRepo }}" == "forgejo" ]]; then + ../helm dependency update . + ../helm dependency build . + elif [[ "${{ inputs.helmRepo }}" == "ingress-nginx" ]]; then + ../helm dependency update ./charts/ingress-nginx + ../helm dependency build ./charts/ingress-nginx + else + echo unknown option helmRepo ${{ inputs.helmRepo }} + exit 1 + fi + git add -A git commit -m "Added helm dependencies" git tag ${{ inputs.tag }}-depends git push origin ${{ inputs.tag }}-depends - - -