Sync Develop
Reusable workflow to sync the develop branch after a release on main. Merges main into develop to keep the development branch up-to-date with released code.
Trigger
yaml
on:
workflow_call:Called after Release Please when release_created == 'true'.
Inputs
No inputs are required.
Secrets
No additional secrets are required. The workflow uses the default GITHUB_TOKEN via permissions.
Permissions
yaml
permissions:
contents: writeRequired to push to the develop branch.
Job: sync
Runs on ubuntu-latest:
- Checkout the
developbranch withfetch-depth: 0(full history). - Configure Git with the
github-actions[bot]user. - Merge
origin/mainintodevelop(git merge origin/main --no-edit). - Push the updated
developbranch.
When to use
This workflow should be called as part of the release pipeline, after Release Please creates a new release:
Release Please creates tag
│
├── post-release (build ZIP, upload)
│
└── sync-develop (merge main → develop)Usage example
yaml
# .github/workflows/release.yml
name: Release
on:
push:
branches: [main]
jobs:
release-please:
uses: middag-io/.github-private/.github/workflows/release-please.yml@workflows-v1
sync-develop:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
uses: middag-io/.github-private/.github/workflows/sync-develop.yml@workflows-v1Conflict resolution
If there are conflicts between main and develop, the merge will fail and the workflow will report an error. In that case, resolve the conflicts manually:
bash
git checkout develop
git pull origin develop
git merge origin/main
# resolve conflicts
git push origin develop