Conversation
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow intended for component/child repositories to notify a parent repository (via repository_dispatch) when updates are pushed, enabling the parent repo to perform a subtree pull sync.
Changes:
- Introduces
.github/workflows/push.ymlto trigger on pushes and manual dispatch. - Collects repo/branch metadata and sends a
repository_dispatchevent with a structured JSON payload. - Publishes a run summary to
GITHUB_STEP_SUMMARY.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| # 【触发条件】 | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # - 自动触发:推送到 dev 或 main 分支时 | ||
| # - 手动触发:Actions → Notify Parent Repository → Run workflow | ||
| # | ||
| # 【工作流程】 | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # 子仓库 push → 触发此工作流 → 调用主仓库 API → 主仓库 subtree pull | ||
| # | ||
| # 【注意事项】 | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # - 主仓库需要配置接收 repository_dispatch 事件的同步工作流 | ||
| # - 如果不需要子仓库到主仓库的同步,可以不使用此文件 | ||
| # | ||
| # ═══════════════════════════════════════════════════════════════════════════════ | ||
|
|
||
| name: Notify Parent Repository | ||
|
|
||
| # 当有新的推送时触发 | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - master | ||
| workflow_dispatch: |
| }') | ||
|
|
||
| curl --fail --show-error -X POST \ | ||
| -H "Accept: application/vnd.github.v3+json" \ |
|
Could it be changed so that the parent repository periodically checks for updates in the sub-repositories? The current approach requires adding workflows to all sub-repositories, resulting in poor scalability. |
First, I've suggested @ZCShou to use the |
…updates