chore(common/dependencies): update helm release common to v2.27.0 #1914
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update metadata files for release | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
getChangedChart: | |
if: startsWith(github.head_ref, 'release-please--branches--main--components--') | |
uses: ./.github/workflows/get-changed-chart.yaml | |
with: | |
pr_number: ${{ github.event.pull_request.number }} | |
update-metadata-files: | |
if: startsWith(github.head_ref, 'release-please--branches--main--components--') | |
runs-on: ubuntu-latest | |
needs: getChangedChart | |
name: update metadata file for release | |
env: | |
CT_TARGET_BRANCH: ${{ github.event.pull_request.base.ref || github.event.repository.default_branch }} | |
CHART: ${{ needs.getChangedChart.outputs.chart }} | |
steps: | |
- name: Validate changed chart | |
if: ${{ needs.getChangedChart.outputs.found != 'true' }} | |
run: | | |
echo 'No chart has been changed?' >&2 | |
exit 1 | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
token: ${{ secrets.ACTIONS_BOT_TOKEN }} | |
- run: pip install yq | |
- name: Install sponge | |
run: sudo apt-get -yq install moreutils | |
- name: set sources in Chart.yaml | |
run: | | |
set -ex | |
version="$(jq -er --arg chart "${CHART}" '.["charts/\($chart)"]' .github/release-please/manifest.json)" | |
#shellcheck disable=SC2016 | |
yq -e -y -Y -i --arg tagSource "https://github.com/${GITHUB_REPOSITORY}/tree/${CHART}-v${version}/charts/${CHART}" --arg branchSource "https://github.com/${GITHUB_REPOSITORY}/tree/${{ github.event.repository.default_branch }}/charts/${CHART}" '.sources=[$tagSource, $branchSource]' "charts/${CHART}/Chart.yaml" | |
- name: Commit Chart.yaml | |
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9 | |
with: | |
message: "ci: [bot] Update sources in 'Chart.yaml'" | |
default_author: github_actions | |
push: true | |
add: charts/${{ env.CHART }}/Chart.yaml | |
- run: ./.github/scripts/prepare-values.sh "charts/$CHART" | |
- run: ./.github/scripts/extract-artifacthub-images.sh "charts/$CHART" | |
- run: ./.github/scripts/enforce-trusted-registries.sh "charts/$CHART" | |
- name: Commit artifacthub images | |
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9 | |
with: | |
message: "ci: [bot] Update images in 'Chart.yaml'" | |
default_author: github_actions | |
push: false | |
add: charts/${{ env.CHART }}/Chart.yaml | |
- run: pip install json-schema-for-humans | |
- name: generate values.md | |
run: | | |
set -ex | |
if ! [[ -f "charts/$CHART/values.schema.json" ]]; then | |
echo "No values.schema.json found for $CHART" >&2 | |
exit 0 | |
fi | |
generate-schema-doc --config-file .github/json-schema-to-md.yaml "charts/$CHART/values.schema.json" "charts/$CHART/values.md" | |
- name: generate Docs | |
uses: docker://jnorwood/helm-docs:v1.14.2@sha256:7e562b49ab6b1dbc50c3da8f2dd6ffa8a5c6bba327b1c6335cc15ce29267979c | |
with: | |
args: -g charts/${{ env.CHART }} | |
- name: Commit README | |
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9 | |
with: | |
message: "ci: [bot] Update 'README.md'" | |
default_author: github_actions | |
push: true | |
add: charts/${{ env.CHART }}/README.md |