Skip to content

Commit 06614c1

Browse files
committed
ci: 添加同步到外部仓库的 GitHub Actions 工作流
添加新的工作流文件以在代码推送或指定工作流完成后,将更改同步到外部仓库。该工作流引用外部可重用工作流配置,简化同步流程并保持代码库一致性。
1 parent 4e22dc1 commit 06614c1

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/sync.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Sync Github To Image (External)
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
workflow_run:
10+
workflows: ["Publish Release"] # 监听的工作流名称
11+
types:
12+
- completed # 监听完成事件
13+
#schedule:
14+
# 定时任务,每天 UTC 时间 0 点运行
15+
#- cron: "0 0 * * *"
16+
workflow_dispatch:
17+
18+
jobs:
19+
sync-gitee:
20+
# 引用外部仓库的可重用工作流
21+
# 格式: {owner}/{repo}/.github/workflows/{filename}@{ref}
22+
uses: GameFrameX/public-github-actions/.github/workflows/sync.yml@main
23+
with:
24+
# 传递参数给外部工作流
25+
target_branch: ${{ github.ref_name }}
26+
repository_name: ${{ github.repository }}
27+
# 组织级别已配置密钥,可以使用 inherit 继承所有密钥
28+
secrets: inherit

0 commit comments

Comments
 (0)