Skip to content

Commit

Permalink
Update v1 chart release action
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <[email protected]>
  • Loading branch information
petewall committed Oct 4, 2024
1 parent 4d0200a commit d26e124
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions .github/workflows/helm-release-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,12 @@ jobs:
latest_tag=$( if ! git describe --tags --abbrev=0 --match='helm-chart/*' 2> /dev/null ; then git rev-list --max-parents=0 --first-parent HEAD; fi )
echo "Running: ct list-changed --chart-dirs charts/k8s-monitoring-v1 --config \"${CT_CONFIGFILE}\" --since \"${latest_tag}\" --target-branch ${{ github.ref_name }}"
changed=$(ct list-changed --config "${CT_CONFIGFILE}" --since "${latest_tag}" --target-branch "${{ github.ref_name }}")
echo "${changed}"
num_changed=$(wc -l <<< "${changed}")
if [[ "${num_changed}" -gt "1" ]] ; then
echo "More than one chart changed, exiting"
exit 1
fi
if [[ -n "${changed}" ]]; then
name=$(yq ".name" < "${changed}/Chart.yaml")
version=$(yq ".version" < "${changed}/Chart.yaml")
if echo "${changed}" | grep "k8s-monitoring-v1"; then
name=$(yq ".name" charts/k8s-monitoring-v1/Chart.yaml)
version=$(yq ".version" charts/k8s-monitoring-v1/Chart.yaml)
echo "Chart name: ${name}"
echo "Chart version: ${version}"
tagname="v${version}"
if [[ $(git tag -l "${tagname}") ]]; then
Expand All @@ -56,10 +47,10 @@ jobs:
else
echo "Releasing ${changed}"
echo "changed=true" >> "${GITHUB_OUTPUT}"
echo "chartpath=${changed}" >> "${GITHUB_OUTPUT}"
echo "chartpath=charts/k8s-monitoring-v1" >> "${GITHUB_OUTPUT}"
fi
else
echo "No charts have changed, skipping release"
echo "k8s-monitoring-v1 has not changed, skipping release"
echo "changed=false" >> "${GITHUB_OUTPUT}"
fi
Expand Down

0 comments on commit d26e124

Please sign in to comment.