mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-02-03 07:49:03 +00:00
96d7dde82f
* chore(deps): update external minor dep helm releases * Auto-generate chart README * Combine dep bumps Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
121 lines
3.6 KiB
YAML
121 lines
3.6 KiB
YAML
name: "Charts: Update Readme"
|
|
|
|
concurrency: update-readme
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths:
|
|
- "charts/**"
|
|
|
|
jobs:
|
|
get-branch:
|
|
name: Get branch
|
|
runs-on: ubuntu-20.04
|
|
outputs:
|
|
branch: ${{ steps.branch-name.outputs.current_branch }}
|
|
|
|
steps:
|
|
- name: Get branch name
|
|
id: branch-name
|
|
uses: tj-actions/branch-names@v5.1
|
|
|
|
generate-readme:
|
|
name: Update changelog
|
|
runs-on: ubuntu-20.04
|
|
needs:
|
|
- get-branch
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: dorny/paths-filter@v2
|
|
id: filter
|
|
with:
|
|
base: ${{ github.ref }}
|
|
list-files: shell
|
|
filters: |
|
|
addedOrModified:
|
|
- added|modified: 'charts/**'
|
|
|
|
- name: Annotate Charts.yaml for Renovate
|
|
if: steps.filter.outputs.addedOrModified == 'true' && startsWith(needs.get-branch.outputs.branch, 'renovate/')
|
|
run: |
|
|
CHARTS=()
|
|
PATHS=(${{ steps.filter.outputs.addedOrModified_files }})
|
|
# Get only the chart paths
|
|
for i in "${PATHS[@]}"
|
|
do
|
|
IFS='/' read -r -a path_parts <<< "$i"
|
|
CHARTS+=("${path_parts[1]}/${path_parts[2]}")
|
|
done
|
|
|
|
# Remove duplicates
|
|
CHARTS=( `for i in ${CHARTS[@]}; do echo $i; done | sort -u` )
|
|
|
|
for i in "${CHARTS[@]}"
|
|
do
|
|
echo "Updating CHANGELOG for chart ${i}"
|
|
IFS='/' read -r -a chart_parts <<< "$i"
|
|
if [ -f "charts/${chart_parts[0]}"/"${chart_parts[1]}/Chart.yaml" ]; then
|
|
./hack/renovate-releasenotes.sh "charts/${chart_parts[0]}"/"${chart_parts[1]}"
|
|
fi
|
|
echo ""
|
|
done
|
|
|
|
- name: Install Helm
|
|
if: steps.filter.outputs.addedOrModified == 'true'
|
|
uses: azure/setup-helm@v1
|
|
with:
|
|
version: v3.6.3
|
|
|
|
- uses: actions/setup-python@v2
|
|
if: steps.filter.outputs.addedOrModified == 'true'
|
|
with:
|
|
python-version: 3.9
|
|
|
|
- name: Install helm-docs
|
|
if: steps.filter.outputs.addedOrModified == 'true'
|
|
run: |
|
|
wget -O /tmp/helm-docs.deb https://github.com/k8s-at-home/helm-docs/releases/download/v0.1.1/helm-docs_0.1.1_Linux_x86_64.deb
|
|
sudo dpkg -i /tmp/helm-docs.deb
|
|
|
|
- name: Generate README for changed charts
|
|
if: steps.filter.outputs.addedOrModified == 'true'
|
|
run: |
|
|
CHARTS=()
|
|
PATHS=(${{ steps.filter.outputs.addedOrModified_files }})
|
|
# Get only the chart paths
|
|
for i in "${PATHS[@]}"
|
|
do
|
|
IFS='/' read -r -a path_parts <<< "$i"
|
|
CHARTS+=("${path_parts[1]}/${path_parts[2]}")
|
|
done
|
|
|
|
# Remove duplicates
|
|
CHARTS=( `for i in ${CHARTS[@]}; do echo $i; done | sort -u` )
|
|
|
|
for i in "${CHARTS[@]}"
|
|
do
|
|
echo "Rendering README for chart ${i}"
|
|
IFS='/' read -r -a chart_parts <<< "$i"
|
|
if [ -f "charts/${chart_parts[0]}"/"${chart_parts[1]}/Chart.yaml" ]; then
|
|
./hack/gen-helm-docs.sh "${chart_parts[0]}" "${chart_parts[1]}"
|
|
fi
|
|
echo ""
|
|
done
|
|
|
|
- name: Create commit
|
|
if: steps.filter.outputs.addedOrModified == 'true'
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
with:
|
|
commit_message: Auto-generate chart README
|
|
|
|
commit_user_name: ${{ github.actor }}
|
|
commit_user_email: ${{ github.actor }}@users.noreply.github.com
|
|
|
|
file_pattern: charts/**/
|