From e6c86b2523b2d4d9e9c3d08f4ac87cfbd73e3830 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Jan 2026 05:17:16 +0000 Subject: [PATCH] fix(ci): checkout main before pushing chart version updates The release workflow was failing because it tried to push from a detached HEAD (tag checkout) to main, but main had already advanced. Fix by fetching and checking out main branch before applying the chart version updates, ensuring we always have the latest state. --- .github/workflows/release.yaml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8a0a1c6..8561f84 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -66,28 +66,30 @@ jobs: files: | config/crd/bases/*.yaml - - name: Update chart version + - name: Commit and push chart version run: | - # Extract version without 'v' prefix VERSION="${GITHUB_REF_NAME#v}" - # Update Chart.yaml + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + # Fetch the latest main branch + git fetch origin main + + # Checkout main branch + git checkout main + + # Apply version updates on main sed -i "s/^version: .*/version: ${VERSION}/" charts/cloudnative-supabase/Chart.yaml sed -i "s/^appVersion: .*/appVersion: ${VERSION}/" charts/cloudnative-supabase/Chart.yaml - - # Update values.yaml image tag sed -i "s/^ tag: .*/ tag: \"${VERSION}\"/" charts/cloudnative-supabase/values.yaml - - name: Commit and push chart version - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" git add charts/cloudnative-supabase/Chart.yaml charts/cloudnative-supabase/values.yaml # Only commit if there are staged changes if git diff --cached --quiet; then echo "Chart already at correct version, skipping commit" else - git commit -m "chore(chart): bump to ${GITHUB_REF_NAME#v}" - git push origin HEAD:main + git commit -m "chore(chart): bump to ${VERSION}" + git push origin main fi