Skip to content

ci: [bot] Update sources in 'Chart.yaml' #1798

ci: [bot] Update sources in 'Chart.yaml'

ci: [bot] Update sources in 'Chart.yaml' #1798

name: Update metadata files for release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- release-please--branches--main--components-*
jobs:
getChangedChart:
uses: ./.github/workflows/get-changed-chart.yaml
update-metadata-files:
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:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
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 -S -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:latest@sha256:2b0681670e69ebd28163abdc276a419ef4a8c0ba9258699847a5ed001fd7de0e
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