ci(ghcr): mirror ghcr-feat-copilot workflow on main for dispatch resolution#5
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
`auto-sync-upstream-copilot.yml` (added in PR #2) dispatches `ghcr-feat-copilot.yml` after a successful clean-merge + build:
```yaml
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).