Update .github/workflows/update-helm-depends.yaml

This commit is contained in:
richardrobertreitz 2025-03-27 19:16:22 +00:00
parent e09c532c96
commit 8091e660f2

View file

@ -11,7 +11,7 @@ on:
options: options:
- argocd - argocd
- forgejo - forgejo
- nginx - ingress-nginx
tag: tag:
description: 'Tag (e.g. v11.0.5)' description: 'Tag (e.g. v11.0.5)'
required: true required: true
@ -22,10 +22,24 @@ jobs:
runs-on: docker runs-on: docker
steps: 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 - name: Checkout helm repo
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
repository: DevFW-CICD/${{ inputs.helmRepo }}-helm repository: ${{ steps.repository.outputs.organization }}/${{ inputs.helmRepo }}-helm
token: ${{ secrets.PAT }} token: ${{ secrets.PAT }}
ref: main ref: main
path: helmworkspace path: helmworkspace
@ -40,15 +54,22 @@ jobs:
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
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 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 fetch --all
git checkout upstream/main git checkout upstream/main
git checkout main git checkout main
git merge upstream/main || true git merge upstream/main || true
git commit || true git commit || true
echo hier
git push origin ${{ inputs.tag }} git push origin ${{ inputs.tag }}
git checkout ${{ inputs.tag }} git checkout ${{ inputs.tag }}
@ -65,13 +86,22 @@ jobs:
mv linux-arm64/helm ../helm mv linux-arm64/helm ../helm
rm -Rf linux-arm64 helm-v3.16.2-linux-arm64.tar.gz rm -Rf linux-arm64 helm-v3.16.2-linux-arm64.tar.gz
fi fi
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 update .
../helm dependency build . ../helm dependency build .
git status 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 add -A
git commit -m "Added helm dependencies" git commit -m "Added helm dependencies"
git tag ${{ inputs.tag }}-depends git tag ${{ inputs.tag }}-depends
git push origin ${{ inputs.tag }}-depends git push origin ${{ inputs.tag }}-depends