Skip to content

Commit 74e3240

Browse files
Clément VALENTINclaude
andcommitted
fix(ci): move sync-develop into Release workflow
- Add sync-develop job directly in release.yml (runs after semantic-release) - Remove separate sync-develop.yml workflow (was racing with release commit) - Use env variable for version (security best practice) This ensures develop is synced immediately after the release commit is pushed, avoiding the race condition that caused version mismatches. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 19f5ccb commit 74e3240

File tree

2 files changed

+44
-50
lines changed

2 files changed

+44
-50
lines changed

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,47 @@ jobs:
259259
echo "docker pull ${{ env.IMAGE_PREFIX }}/backend:$VERSION" >> $GITHUB_STEP_SUMMARY
260260
echo "docker pull ${{ env.IMAGE_PREFIX }}/frontend:$VERSION" >> $GITHUB_STEP_SUMMARY
261261
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
262+
263+
# ===========================================
264+
# Sync develop with main (only after main release)
265+
# ===========================================
266+
sync-develop:
267+
name: Sync develop
268+
needs: [release]
269+
# Only sync when releasing from main (not develop)
270+
if: >
271+
needs.release.outputs.new_release_published == 'true' &&
272+
github.ref_name == 'main'
273+
runs-on: ubuntu-latest
274+
steps:
275+
- name: Checkout
276+
uses: actions/checkout@v4
277+
with:
278+
fetch-depth: 0
279+
token: ${{ secrets.GITHUB_TOKEN }}
280+
281+
- name: Configure Git
282+
run: |
283+
git config user.name "github-actions[bot]"
284+
git config user.email "github-actions[bot]@users.noreply.github.com"
285+
286+
- name: Sync develop with main
287+
env:
288+
RELEASE_VERSION: ${{ needs.release.outputs.new_release_version }}
289+
run: |
290+
# Fetch all branches
291+
git fetch origin main develop
292+
293+
# Log current state
294+
echo "=== Main branch HEAD ==="
295+
git log -1 --oneline origin/main
296+
297+
echo "=== Develop branch HEAD ==="
298+
git log -1 --oneline origin/develop
299+
300+
# Checkout develop and merge main
301+
git checkout develop
302+
git merge origin/main -m "chore: sync develop with main after v${RELEASE_VERSION} [skip ci]"
303+
git push origin develop
304+
305+
echo "✅ Develop synced with main"

.github/workflows/sync-develop.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)