forked from wirequery/wirequery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
copy.bara.sky
53 lines (49 loc) · 1.67 KB
/
copy.bara.sky
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
destinationUrl = "ssh://git@github.com/wirequery/wirequery.git"
sotUrl = "ssh://git@github.com/wirequery/wirequery-ee.git"
files = glob(["**"], exclude = ["**/ee/**", ".github/workflows/push-to-public-repo.yml"])
code_transformations = [
core.replace(
before = "/ee/",
after = "/ce/",
paths = glob(["**"], exclude = ["**/ce/**", "**/ee/**", "copy.bara.sky"]),
),
]
core.workflow(
name = "push",
origin = git.origin(
url = sotUrl,
ref = "main",
),
destination = git.github_destination(
url = destinationUrl,
push = "main",
),
origin_files = files,
authoring = authoring.pass_thru("Wouter Nederhof <wouter.nederhof@gmail.com>"),
mode = "ITERATIVE",
transformations = [
metadata.restore_author("ORIGINAL_AUTHOR", search_all_changes = True),
metadata.expose_label("COPYBARA_INTEGRATE_REVIEW"),
] + code_transformations,
)
core.workflow(
name = "pr",
origin = git.github_pr_origin(
url = destinationUrl,
branch = "main",
),
destination = git.github_pr_destination(
url = sotUrl,
destination_ref = "main",
),
destination_files = files,
origin_files = files,
authoring = authoring.pass_thru("Wouter Nederhof <wouter.nederhof@gmail.com>"),
smart_prune = True,
mode = "CHANGE_REQUEST",
set_rev_id = False,
transformations = [
metadata.save_author("ORIGINAL_AUTHOR"),
metadata.expose_label("GITHUB_PR_NUMBER", new_name = "Closes", separator = destinationUrl.replace("git@github.com:", " ").replace("ssh://git@github.com/", " ").replace(".git", "#")),
] + core.reverse(code_transformations),
)