Skip to content

Commit

Permalink
Extract package name from Chart.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Josca committed Jan 24, 2025
1 parent 741db62 commit e2d7243
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/helm-chart-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ jobs:
GHCR_PATH="$(echo "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/charts" | tr '[:upper:]' '[:lower:]')"
for chart in $(find ./charts -mindepth 2 -maxdepth 2 -type d); do
VERSION=$(awk '/^version:/ {print $2}' "$chart/Chart.yaml")
NAME=$(awk '/^name:/ {print $2}' "$chart/Chart.yaml")
if [ "${GITHUB_REF_NAME}" != "${{ github.event.repository.default_branch }}" ]; then
VERSION="$VERSION-${GITHUB_REF_NAME//\//-}"
fi
# Update Helm chart dependencies, then package
helm dependency update "$chart"
helm package "$chart" --version "$VERSION"
PACKAGE_FILE="$chart-$VERSION.tgz"
PACKAGE_FILE="$NAME-$VERSION.tgz"
echo "Pushing $PACKAGE_FILE to oci://$GHCR_PATH (version: $VERSION)"
helm push "$PACKAGE_FILE" "oci://$GHCR_PATH"
Expand Down

0 comments on commit e2d7243

Please sign in to comment.