Skip to content

Commit bc7185d

Browse files
committed
auto sync #3
1 parent 41642e6 commit bc7185d

File tree

9 files changed

+37
-70
lines changed

9 files changed

+37
-70
lines changed

.github/workflows/sync.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ name: Test
1111
on:
1212
workflow_call:
1313
inputs:
14+
target_sync_repo:
15+
description: "目标(下游)仓库,格式为 owner/repository ,必须指定"
16+
required: true
17+
type: string
1418
target_sync_branch:
15-
description: "目标(下游)同步分支,默认为 github.ref ,根据实际情况修改"
19+
description: "目标(下游)同步分支,必须指定"
20+
required: true
1621
type: string
17-
default: ${{ github.ref }}
1822
upstream_sync_repo:
1923
description: "上游仓库,默认为 github.repository ,根据实际情况修改"
2024
type: string
@@ -39,6 +43,7 @@ jobs:
3943
- name: Checkout target repo
4044
uses: actions/checkout@v4
4145
with:
46+
repository: ${{ inputs.target_sync_repo }}
4247
fetch-depth: 0
4348
token: ${{ secrets.TOEKN_FOREVER_FULL_WRITE }} # 使用具有完全写入权限的 TOKEN(必须包含 workflows )
4449
# REQUIRED if your upstream repo is private (see wiki), 启用会造成 check-branch-exists 失败

.github/workflows/test-all.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,39 @@ jobs:
1515
secrets: inherit
1616
with:
1717
name: "test"
18+
repo_name: "prototype-test/dist-repo-use-branch_test"
1819
test2:
1920
uses: ./.github/workflows/validation-proxy.yml
2021
needs: []
2122
secrets: inherit
2223
with:
2324
name: "test2"
25+
repo_name: "prototype-test/dist-repo-use-branch_test2"
2426
test3:
2527
uses: ./.github/workflows/validation-proxy.yml
2628
needs: []
2729
secrets: inherit
2830
with:
2931
name: "test3"
32+
repo_name: "prototype-test/dist-repo-use-branch_test3"
3033
test4:
3134
uses: ./.github/workflows/validation-proxy.yml
3235
needs: []
3336
secrets: inherit
3437
with:
3538
name: "test4"
39+
repo_name: "prototype-test/dist-repo-use-branch_test4"
3640
test5:
3741
uses: ./.github/workflows/validation-proxy.yml
3842
needs: []
3943
secrets: inherit
4044
with:
4145
name: "test5"
46+
repo_name: "prototype-test/dist-repo-use-branch_test5"
4247
test6:
4348
uses: ./.github/workflows/validation-proxy.yml
4449
needs: []
4550
secrets: inherit
4651
with:
47-
name: "test6"
52+
name: "test6"
53+
repo_name: "prototype-test/dist-repo-use-branch_test6"

.github/workflows/test.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
name: test
22

33
on:
4-
workflow_call:
54
workflow_dispatch:
5+
inputs:
6+
name:
7+
description: "目标名,必须指定"
8+
required: true
9+
type: string
10+
repo_name:
11+
description: "目标(下游)仓库,格式为 owner/repository ,必须指定"
12+
required: true
13+
type: string
614

715
jobs:
816
build:
917
uses: ./.github/workflows/validation-proxy.yml
1018
secrets: inherit
1119
with:
12-
name: "test"
20+
name: ${{ inputs.name }}
21+
repo_name: ${{ inputs.repo_name }}

.github/workflows/test2.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/test3.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/test4.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/test5.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/test6.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/validation-proxy.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
workflow_call:
55
inputs:
66
name:
7+
description: "目标名,必须指定"
8+
required: true
9+
type: string
10+
repo_name:
11+
description: "目标(下游)仓库,格式为 owner/repository ,必须指定"
712
required: true
813
type: string
914
env:
@@ -31,14 +36,16 @@ jobs:
3136
with:
3237
repository: ${{ needs.setup.outputs.repository }}
3338
main_branch: ${{ needs.setup.outputs.main_branch }}
34-
cd_path: "${{ inputs.name }}/ci"
35-
cd_branch: "${{ needs.setup.outputs.cd_branch_prefix }}${{ inputs.name }}"
36-
dist_path: "${{ inputs.name }}/src"
37-
dist_branch: "${{ needs.setup.outputs.dist_branch_prefix }}${{ inputs.name }}"
39+
cd_path: ${{ inputs.name }}/ci
40+
cd_branch: ${{ needs.setup.outputs.cd_branch_prefix }}${{ inputs.name }}
41+
dist_path: ${{ inputs.name }}/src
42+
dist_branch: ${{ needs.setup.outputs.dist_branch_prefix }}${{ inputs.name }}
3843
sync:
3944
uses: ./.github/workflows/sync.yml
4045
secrets: inherit
4146
needs: [setup, build]
4247
with:
43-
upstream_sync_branch: "${{ needs.setup.outputs.dist_branch_prefix }}${{ inputs.name }}"
48+
target_sync_repo: ${{ inputs.repo_name }}
49+
target_sync_branch: ${{ needs.setup.outputs.main_branch }}
50+
upstream_sync_branch: ${{ needs.setup.outputs.dist_branch_prefix }}${{ inputs.name }}
4451
upstream_sync_repo: ${{ needs.setup.outputs.repository }}

0 commit comments

Comments
 (0)