Skip to content

feat: add bidirectional sync workflow - #13

Merged
Mearman merged 1 commit into
mainfrom
exadev-bidirectional-sync
Feb 17, 2026
Merged

Mearman merged 1 commit into
mainfrom
exadev-bidirectional-sync

Conversation

@Mearman

@Mearman Mearman commented Feb 17, 2026

Copy link
Copy Markdown
Member

Adds automated bidirectional sync between ExaDev and adpeak forks. On push to main, the workflow attempts to rebase and sync changes to the other repo. If conflicts occur, it creates a PR for manual resolution and cleans up stale sync branches older than 7 days.

Required configuration:

  • Secret: SYNC_PRIVATE_KEY — GitHub App private key for authentication
  • Vars: EXADEV_APP_ID and ADPEAK_APP_ID — GitHub App IDs for each org

@Mearman
Mearman force-pushed the exadev-bidirectional-sync branch from dfa7342 to efb5de4 Compare February 17, 2026 10:43
@claude
claude Bot dismissed a stale review February 17, 2026 10:45

Superseded by new commit

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow addresses previous feedback on configuration validation and portability, but introduces a critical infinite loop issue. When a successful rebase pushes to the target repo's main branch, that push triggers the target's sync workflow, which then syncs back, creating a ping-pong loop.

The loop detection on line 34 checks for [sync from in commit messages, but no such marker is added during the push on line 97. This must be fixed before merging.

Additionally, the cleanup step condition is incomplete and will fail when referencing an undefined token output.

- name: Check if already a sync commit
id: check
run: |
if git log --format="%s" -1 | grep -q "\[sync from"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop detection only checks the most recent commit message. If someone manually pushes multiple commits where only an earlier one has the marker, this will still trigger a sync and potentially create a loop.

A safer approach: check the entire range of new commits since the last sync, or use a more robust marker like a git note or workflow run ID.


if git rebase target/main 2>/dev/null; then
# Rebase successful - push directly to main
git push target HEAD:main

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a successful rebase and push, there's no commit message marker added to prevent loops. When the push to target triggers its own sync workflow, it will attempt to sync back, creating an infinite loop despite the check on line 34.

The workflow needs to either:

  1. Add a [sync from SOURCE] marker in the commit message when pushing
  2. Use a different mechanism to prevent bidirectional ping-pong

echo "::notice::Created PR for conflict resolution"

- name: Cleanup old sync branches
if: steps.sync.outputs.skip != 'true'

@claude claude Bot Feb 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanup step condition only checks steps.sync.outputs.skip but also needs steps.check.outputs.skip because it references steps.token.outputs.token which is only generated when we don't skip early.

If we skip at line 34, the token step (line 53-59) never runs, so steps.token.outputs.token will be empty, causing the cleanup to fail.

Suggested change
if: steps.sync.outputs.skip != 'true'
- name: Cleanup old sync branches
if: steps.check.outputs.skip != 'true' && steps.sync.outputs.skip != 'true'

@Mearman
Mearman force-pushed the exadev-bidirectional-sync branch from efb5de4 to e72a494 Compare February 17, 2026 10:50
@claude

claude Bot commented Feb 17, 2026

Copy link
Copy Markdown

Re-verified after recent force pushes. The critical infinite loop issue (no marker added at line 98) and incomplete cleanup condition (line 153) still need to be addressed before this can merge.

Adds workflow to sync changes between ExaDev and adpeak repos.
Rebases on push; creates PR for manual conflict resolution.
@Mearman
Mearman force-pushed the exadev-bidirectional-sync branch from e72a494 to 1e4b04d Compare February 17, 2026 10:53
@Mearman
Mearman merged commit 7a55864 into main Feb 17, 2026
2 checks passed
@Mearman
Mearman deleted the exadev-bidirectional-sync branch February 17, 2026 10:59
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant