diff --git a/.github/workflows/bump-consumer-chart-image.yaml b/.github/workflows/bump-consumer-chart-image.yaml index 6f69da8..b59b930 100644 --- a/.github/workflows/bump-consumer-chart-image.yaml +++ b/.github/workflows/bump-consumer-chart-image.yaml @@ -18,6 +18,11 @@ jobs: name: Bump cdc.image.tag in core-provider-chart runs-on: ubuntu-latest steps: + # Needed to regenerate the chart's cdc-runtime-template golden (helm template) below. + - name: Install Helm + uses: azure/setup-helm@v4 + with: + version: v3.19.0 - name: Open chart image-tag bump PR env: GH_TOKEN: ${{ secrets.PAT }} @@ -39,13 +44,20 @@ jobs: # Idempotent in-place set of the pinned CDC image tag. yq -i ".cdc.image.tag = \"${TAG}\"" chart/values.yaml + # The cdc-runtime-template golden snapshots the CDC image tag, so a tag-only bump would + # fail the chart's cdc-template check and the PR would be closed unmerged. Regenerate the + # golden alongside the bump so the PR lands green and mergeable. + if [ -f hack/verify-cdc-template.sh ]; then + ./hack/verify-cdc-template.sh --update + fi + if git diff --quiet; then echo "chart cdc.image.tag already ${TAG} — nothing to do." exit 0 fi git checkout -b "$BRANCH" 2>/dev/null || { git push origin --delete "$BRANCH" 2>/dev/null || true; git checkout -b "$BRANCH"; } - git add chart/values.yaml + git add -A git commit -m "chore(cdc): bump composition-dynamic-controller image to ${TAG} Automated by the composition-dynamic-controller release (${TAG}): aligns the chart's @@ -53,7 +65,7 @@ jobs: git push origin "$BRANCH" PR_TITLE="chore(cdc): bump composition-dynamic-controller image to ${TAG}" - PR_BODY="Automated on the CDC \`${TAG}\` release: aligns \`cdc.image.tag\` in \`chart/values.yaml\` so the chart deploys the just-released controller." + PR_BODY="Automated on the CDC \`${TAG}\` release: aligns \`cdc.image.tag\` in \`chart/values.yaml\` (and refreshes the \`cdc-runtime-template\` golden) so the chart deploys the just-released controller." PR_STATE=$(gh pr view "$BRANCH" --repo "$TARGET_REPO" --json state -q .state 2>/dev/null || echo "NONE") if [ "$PR_STATE" = "OPEN" ]; then echo "PR already open for $BRANCH."