From ba1893871a739e94b27beadc743a37d25a767d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=E1=B4=87=CA=80=C9=B4=E1=B4=85=20S=E1=B4=84=CA=9C?= =?UTF-8?q?=E1=B4=8F=CA=80=C9=A2=E1=B4=87=CA=80s?= Date: Wed, 5 Jan 2022 17:27:15 +0100 Subject: [PATCH] ci: Add renovate-specific workflow --- .../generate-renovate-changelog.yaml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/generate-renovate-changelog.yaml diff --git a/.github/workflows/generate-renovate-changelog.yaml b/.github/workflows/generate-renovate-changelog.yaml new file mode 100644 index 00000000..c2f963c2 --- /dev/null +++ b/.github/workflows/generate-renovate-changelog.yaml @@ -0,0 +1,68 @@ +name: "Charts: Update changelog for Renovate PR" + +concurrency: update-renovate-pr-changelog + +on: + push: + branches: +# - "renovate/**" + - "test/**" + paths: + - "charts/**" + +jobs: + update-changelog: + name: Update changelog + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - uses: dorny/paths-filter@v2 + id: filter + with: + base: ${{ github.ref }} + list-files: shell + filters: | + addedOrModified: + - added|modified: 'charts/**' + + - name: Run against 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 "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 "" + cat "charts/${chart_parts[0]}"/"${chart_parts[1]}/Chart.yaml" + done + + # - name: Create commit + # if: steps.filter.outputs.addedOrModified == 'true' + # uses: stefanzweifel/git-auto-commit-action@v4 + # with: + # push_options: --force + # commit_message: Auto-generate chart README + + # commit_user_name: ${{ github.actor }} + # commit_user_email: ${{ github.actor }}@users.noreply.github.com + + # file_pattern: charts/**/