2022-03-30 08:46:56 +00:00
|
|
|
name: "Charts: Update README"
|
|
|
|
|
|
|
|
on:
|
2022-03-31 18:41:12 +00:00
|
|
|
workflow_dispatch:
|
2022-03-30 08:46:56 +00:00
|
|
|
inputs:
|
|
|
|
modifiedCharts:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
isRenovatePR:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
outputs:
|
|
|
|
commitHash:
|
|
|
|
description: "The most recent commit hash at the end of this workflow"
|
|
|
|
value: ${{ jobs.generate-changelog.outputs.commitHash }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
validate-changelog:
|
|
|
|
name: Validate changelog
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-04-22 19:28:18 +00:00
|
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
2022-03-30 08:46:56 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Check changelog annotations
|
|
|
|
if: inputs.isRenovatePR != 'true'
|
|
|
|
run: |
|
|
|
|
CHARTS=(${{ inputs.modifiedCharts }})
|
|
|
|
for i in "${CHARTS[@]}"
|
|
|
|
do
|
|
|
|
IFS='/' read -r -a chart_parts <<< "$i"
|
|
|
|
./.github/scripts/check-releasenotes.sh "charts/${chart_parts[0]}/${chart_parts[1]}"
|
|
|
|
echo ""
|
|
|
|
done
|
|
|
|
|
|
|
|
generate-changelog:
|
|
|
|
name: Generate changelog annotations
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- validate-changelog
|
|
|
|
outputs:
|
|
|
|
commitHash: ${{ steps.save-commit-hash.outputs.commit_hash }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-04-22 19:28:18 +00:00
|
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
2022-03-30 08:46:56 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Install Kubernetes tools
|
|
|
|
if: inputs.isRenovatePR == 'true'
|
2022-06-07 17:41:19 +00:00
|
|
|
uses: yokawasa/action-setup-kube-tools@ce0b2d7df14d57e25dc8959d693692c9aff5d3c6 # tag=v0.8.1
|
2022-03-30 08:46:56 +00:00
|
|
|
with:
|
|
|
|
setup-tools: |
|
|
|
|
yq
|
|
|
|
yq: "4.20.1"
|
|
|
|
|
|
|
|
- name: Annotate Charts.yaml for Renovate PR's
|
|
|
|
if: inputs.isRenovatePR == 'true'
|
|
|
|
env:
|
|
|
|
DEFAULT_BRANCH: "${{ github.event.repository.default_branch }}"
|
|
|
|
run: |
|
|
|
|
CHARTS=(${{ inputs.modifiedCharts }})
|
|
|
|
for i in "${CHARTS[@]}"
|
|
|
|
do
|
|
|
|
IFS='/' read -r -a chart_parts <<< "$i"
|
|
|
|
./.github/scripts/renovate-releasenotes.sh "charts/${chart_parts[0]}/${chart_parts[1]}"
|
|
|
|
echo ""
|
|
|
|
done
|
|
|
|
|
|
|
|
- name: Create commit
|
|
|
|
id: create-commit
|
|
|
|
if: inputs.isRenovatePR == 'true'
|
2022-04-16 06:32:47 +00:00
|
|
|
uses: stefanzweifel/git-auto-commit-action@49620cd3ed21ee620a48530e81dba0d139c9cb80 # tag=v4
|
2022-03-30 08:46:56 +00:00
|
|
|
with:
|
|
|
|
file_pattern: charts/**/
|
|
|
|
commit_message: "chore: Auto-update chart metadata [skip ci]"
|
|
|
|
commit_user_name: ${{ github.actor }}
|
|
|
|
commit_user_email: ${{ github.actor }}@users.noreply.github.com
|
|
|
|
|
|
|
|
- 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 }}'
|
|
|
|
else
|
|
|
|
echo "::set-output name=commit_hash::${GITHUB_SHA}"
|
|
|
|
fi
|