Skip to content

ci: add feat/copilot auto-sync, drop unused main→dev retarget#2

Merged
conversun merged 2 commits into
mainfrom
ci/auto-sync-feat-copilot
May 14, 2026
Merged

ci: add feat/copilot auto-sync, drop unused main→dev retarget#2
conversun merged 2 commits into
mainfrom
ci/auto-sync-feat-copilot

Conversation

@conversun

@conversun conversun commented May 14, 2026

Copy link
Copy Markdown
Owner

Summary

Two related CI changes on the default branch:

  1. Add `.github/workflows/auto-sync-upstream-copilot.yml` — a parameterized sibling of `auto-sync-upstream.yml` that mirrors `upstream/main` into `feat/copilot` on a daily schedule.
  2. Drop `.github/workflows/auto-retarget-main-pr-to-dev.yml` — this fork has no `dev` branch, so the workflow fails on every main PR with "Proposed base branch 'dev' was not found" and only adds red-X noise.

1. New: `auto-sync-upstream-copilot.yml`

The existing auto-sync workflow only targets `remote-fix`. `feat/copilot` has to be hand-merged (last manual upstream merge `65aa351e`). Automating prevents drift.

Parameterized clone of `auto-sync-upstream.yml` with isolated identity:

Field auto-sync-upstream auto-sync-upstream-copilot
`name` auto-sync-upstream auto-sync-upstream-copilot
`cron` `0 2 * * *` `30 2 * * *` (offset 30m)
`concurrency.group` auto-sync-upstream auto-sync-upstream-copilot
`TARGET_BRANCH` remote-fix feat/copilot
`PR_BRANCH` auto-sync/upstream-main auto-sync/upstream-main-copilot
Downstream trigger ghcr-remote-fix.yml ghcr-feat-copilot.yml
PR label auto-sync auto-sync-copilot

Three paths (unchanged from the original):

  1. clean merge + `go build` ok → push `feat/copilot` → dispatch `ghcr-feat-copilot.yml`
  2. clean merge + `go build` fail → push merge commit to `auto-sync/upstream-main-copilot` → open PR
  3. conflict → push upstream tip to `auto-sync/upstream-main-copilot` for web-based resolution

Lives only on `main` — `schedule` events only fire from the default branch, matching the precedent set by `d87cdbcc` (which removed the duplicate of `auto-sync-upstream.yml` from `remote-fix`).

2. Drop: `auto-retarget-main-pr-to-dev.yml`

The workflow retargets every PR with `base=main` to `base=dev`. On the upstream repo (router-for-me/CLIProxyAPI) this makes sense — they have a main/dev branch model. This fork doesn't, so the API call fails with:

```
Failed to retarget PR #N to dev: Validation Failed:
{"message":"Proposed base branch 'dev' was not found", ...}
```

The retarget itself fails inside a catch block and returns early, so the PR base is left intact — but every main PR ends up with a red 'retarget' check. Removing the file on the default branch disables the `pull_request_target` trigger fork-wide.

conversun added 2 commits May 14, 2026 12:20
Parameterized clone of auto-sync-upstream.yml that mirrors the
upstream router-for-me/CLIProxyAPI:main into feat/copilot instead of
remote-fix.

Key differences from the existing workflow:
- name: auto-sync-upstream-copilot
- cron: '30 2 * * *' (offset 30m from auto-sync-upstream to avoid
  fighting over scheduler / log timing)
- concurrency.group: auto-sync-upstream-copilot (isolated from the
  remote-fix sync; both can run in parallel safely)
- TARGET_BRANCH=feat/copilot, PR_BRANCH=auto-sync/upstream-main-copilot
- Downstream image build dispatched against ghcr-feat-copilot.yml
- PR label: auto-sync-copilot (keeps copilot sync PRs distinct from
  the remote-fix sync stream)

Lives only on the default branch (main); schedule events only fire
from there, mirroring the existing precedent.
The workflow retargets every PR with base=main to base=dev. This
serves upstream router-for-me/CLIProxyAPI's main/dev branch model,
but this fork doesn't have a 'dev' branch — every main PR triggers
a failed run with:

  Failed to retarget PR #N to dev: Validation Failed:
  {"message":"Proposed base branch 'dev' was not found", ...}

The retarget itself fails (catch + return), so the PR base is left
intact — but every main PR shows a red 'retarget' check, which is
noise. Removing the file on the default branch disables the
pull_request_target trigger fork-wide.
@conversun conversun changed the title ci(auto-sync): add upstream sync workflow for feat/copilot ci: add feat/copilot auto-sync, drop unused main→dev retarget May 14, 2026
@conversun conversun merged commit 48b3ce2 into main May 14, 2026
3 of 4 checks passed
@conversun conversun deleted the ci/auto-sync-feat-copilot branch May 14, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant