diff --git a/.github/workflows/charts-renovate.yaml b/.github/workflows/charts-renovate.yaml new file mode 100644 index 00000000000..0fe45a5ec3e --- /dev/null +++ b/.github/workflows/charts-renovate.yaml @@ -0,0 +1,47 @@ +name: "Charts: Renovate" + +on: + push: + branches: + - 'renovate/**' + tags-ignore: + - '**' + +jobs: + folderfix: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v1 + with: + version: v3.5.2 + + - name: update folder names and dependencies + run: | + for chart in charts/*; do + if [ -d "${chart}" ]; then + maxfolderversion=$(ls -l ${chart} | grep ^d | awk '{print $9}' | tail -n 1) + maxchartversion=$(cat ${chart}/${maxfolderversion}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }') + chartname=$(basename ${chart}) + echo "Processing: ${chart} - folder: ${maxfolderversion} - version: ${maxchartversion}" + helm dependency update ${chart}/${maxfolderversion} + if [ "${maxfolderversion}" != "${maxchartversion}" ]; then + mv -f ${chart}/${maxfolderversion} ${chart}/${maxchartversion} + echo "renamed ${chart}/${maxfolderversion} to ${chart}/${maxchartversion}" + fi + fi + done + + - name: Commit and push updated charts + run: | + git add --all + git commit --all -m "Update-Folder-Names-and-Dependencies" + git push