Skip to content

feat(ci): add GitHub Actions workflow to notify parent repository on …#360

Open
ZCShou wants to merge 1 commit intodevfrom
sync
Open

feat(ci): add GitHub Actions workflow to notify parent repository on …#360
ZCShou wants to merge 1 commit intodevfrom
sync

Conversation

@ZCShou
Copy link
Copy Markdown

@ZCShou ZCShou commented Mar 18, 2026

…updates

Copilot AI review requested due to automatic review settings March 18, 2026 02:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.yml to trigger on pushes and manual dispatch.
  • Collects repo/branch metadata and sends a repository_dispatch event 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.

Comment on lines +28 to +52
# 【触发条件】
# ─────────────────────────────────────────────────────────────────────────────
# - 自动触发:推送到 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" \
@equation314
Copy link
Copy Markdown
Member

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.

@AsakuraMizu
Copy link
Copy Markdown
Contributor

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 workflow_call approach to simplify the configuration yaml in each sub repo, which may make it better. And you've inspired me that if we can use webhooks.

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.

4 participants