51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
name: "Charts: Renovate"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'renovate/**'
|
|
- 'update/**'
|
|
tags-ignore:
|
|
- '**'
|
|
|
|
jobs:
|
|
folderfix:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
token: ${{ secrets.BOT_TOKEN }}
|
|
|
|
- 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" || exit 0
|
|
git push || exit 0
|