Skip to content

ci(ghcr): mirror ghcr-feat-copilot workflow on main for dispatch resolution#5

Merged
conversun merged 1 commit into
mainfrom
ci/ghcr-feat-copilot-on-main
May 14, 2026
Merged

ci(ghcr): mirror ghcr-feat-copilot workflow on main for dispatch resolution#5
conversun merged 1 commit into
mainfrom
ci/ghcr-feat-copilot-on-main

Conversation

@conversun

Copy link
Copy Markdown
Owner

Why

`auto-sync-upstream-copilot.yml` (added in PR #2) dispatches `ghcr-feat-copilot.yml` after a successful clean-merge + build:

```yaml

  • name: Trigger downstream image build
    if: steps.merge.outputs.clean == 'true' && steps.build.outputs.ok == 'true'
    env:
    GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    run: gh workflow run ghcr-feat-copilot.yml --repo "${{ github.repository }}" --ref "${TARGET_BRANCH}"
    ```

GitHub Actions requires workflows triggered via `workflow_dispatch` to exist on the default branch. `ghcr-feat-copilot.yml` only lived on `feat/copilot` — the dispatch step would fail with "workflow not found".

We can't rely on the push event either: the auto-sync push uses `GITHUB_TOKEN`, and GitHub explicitly does not cascade those events to other workflows (with the exception of `workflow_dispatch` / `repository_dispatch`). Explicit dispatch is the supported workaround.

This mirrors the precedent set in `8a2e2e0f`, which added `ghcr-remote-fix.yml` to main for the same reason.

What this PR does

Adds `.github/workflows/ghcr-feat-copilot.yml` to `main`, byte-identical to the `feat/copilot` copy.

Why this won't double-build

The on-trigger filter in the file is:

```yaml
on:
workflow_dispatch:
push:
branches:
- feat/copilot
```

Pushes to main do not match `branches: [feat/copilot]`, so the main copy is a pure dispatch-resolution stub. Actual builds still run against the `--ref feat/copilot` checkout requested by `auto-sync-upstream-copilot`.

Verification

After merge:

```
gh workflow run ghcr-feat-copilot.yml --repo conversun/CLIProxyAPIPlus --ref feat/copilot
```

should kick off a build (today's smoke test of the dispatch path before tomorrow's 02:30 UTC scheduled sync runs).

…lution

auto-sync-upstream-copilot.yml dispatches ghcr-feat-copilot.yml after
a successful clean-merge + build:

  gh workflow run ghcr-feat-copilot.yml --repo "${{ github.repository }}" \
                --ref "${TARGET_BRANCH}"

GitHub Actions requires workflows triggered via workflow_dispatch to
exist on the default branch. The file only lived on feat/copilot, so
the dispatch step would fail with 'workflow not found'.

The push event from auto-sync (which uses GITHUB_TOKEN) does not
cascade to ghcr-feat-copilot's 'on: push' trigger — that's a
documented GitHub Actions safety to prevent recursion. The explicit
dispatch is the supported workaround.

This mirrors the precedent set in 8a2e2e0, which added
ghcr-remote-fix.yml to main for the same reason.

The main copy is byte-identical to the feat/copilot copy. Since the
'on: push: branches: [feat/copilot]' filter excludes main, the file
on main is purely a dispatch resolution stub — actual builds still
run against the feat/copilot ref.
@conversun conversun merged commit 08a8352 into main May 14, 2026
3 checks passed
@conversun conversun deleted the ci/ghcr-feat-copilot-on-main branch May 14, 2026 06:42
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