diff --git a/.github/workflows/charts-readme.yaml b/.github/workflows/charts-changelog.yaml similarity index 66% rename from .github/workflows/charts-readme.yaml rename to .github/workflows/charts-changelog.yaml index 953259b7..cce43f2f 100644 --- a/.github/workflows/charts-readme.yaml +++ b/.github/workflows/charts-changelog.yaml @@ -11,8 +11,8 @@ on: type: string outputs: commitHash: - description: "The commit hash from the README.md upate" - value: ${{ jobs.generate-readme.outputs.commitHash }} + description: "The most recent commit hash at the end of this workflow" + value: ${{ jobs.generate-changelog.outputs.commitHash }} jobs: validate-changelog: @@ -35,29 +35,25 @@ jobs: echo "" done - generate-readme: - name: Generate chart README files + generate-changelog: + name: Generate changelog annotations runs-on: ubuntu-latest needs: - validate-changelog outputs: - commitHash: ${{ steps.store-commit-hash.outputs.commit_hash }} + commitHash: ${{ steps.save-commit-hash.outputs.commit_hash }} steps: - name: Checkout uses: actions/checkout@v2 - name: Install Kubernetes tools + if: inputs.isRenovatePR == 'true' uses: yokawasa/action-setup-kube-tools@v0.8.0 with: setup-tools: | yq yq: "4.16.2" - - name: Install helm-docs - 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: Annotate Charts.yaml for Renovate PR's if: inputs.isRenovatePR == 'true' run: | @@ -70,32 +66,18 @@ jobs: echo "" done - - name: Generate README for changed charts in Renovate PR's - if: inputs.isRenovatePR == 'true' - run: | - CHARTS=(${{ inputs.modifiedCharts }}) - for i in "${CHARTS[@]}" - do - printf "Rendering README for chart %s\n" "${i}" - IFS='/' read -r -a chart_parts <<< "$i" - if [ -f "charts/${chart_parts[0]}"/"${chart_parts[1]}/Chart.yaml" ]; then - ./.github/scripts/gen-helm-docs.sh "${chart_parts[0]}" "${chart_parts[1]}" - fi - echo "" - done - - name: Create commit id: create-commit if: inputs.isRenovatePR == 'true' uses: stefanzweifel/git-auto-commit-action@v4 with: file_pattern: charts/**/ - commit_message: Auto-update chart metadata and README + commit_message: "chore: Auto-update chart metadata [skip ci]" commit_user_name: ${{ github.actor }} commit_user_email: ${{ github.actor }}@users.noreply.github.com - - name: Store commit hash - id: store-commit-hash + - name: Save commit hash + id: save-commit-hash run: | if [ "${{ steps.create-commit.outputs.changes_detected || 'unknown' }}" == "true" ]; then echo '::set-output name=commit_hash::${{ steps.create-commit.outputs.commit_hash }}' diff --git a/.github/workflows/pr-validate.yaml b/.github/workflows/pr-validate.yaml index cebb881c..6ec2950e 100644 --- a/.github/workflows/pr-validate.yaml +++ b/.github/workflows/pr-validate.yaml @@ -20,8 +20,8 @@ jobs: with: modifiedFiles: ${{ needs.pr-metadata.outputs.addedOrModifiedFiles }} - charts-readme: - uses: k8s-at-home/charts/.github/workflows/charts-readme.yaml@master + charts-changelog: + uses: k8s-at-home/charts/.github/workflows/charts-changelog.yaml@master needs: - pr-metadata - pre-commit-check @@ -33,15 +33,15 @@ jobs: uses: k8s-at-home/charts/.github/workflows/charts-lint.yaml@master needs: - pr-metadata - - charts-readme + - charts-changelog with: - checkoutCommit: ${{ needs.charts-readme.outputs.commitHash }} + checkoutCommit: ${{ needs.charts-changelog.outputs.commitHash }} charts-test: uses: k8s-at-home/charts/.github/workflows/charts-test.yaml@master needs: - pr-metadata - - charts-readme + - charts-changelog - charts-lint with: - checkoutCommit: ${{ needs.charts-readme.outputs.commitHash }} + checkoutCommit: ${{ needs.charts-changelog.outputs.commitHash }}