-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-rebuild-rc.json
104 lines (104 loc) · 3.48 KB
/
git-rebuild-rc.json
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{
"local": [
{
"type": "validate-branch-names",
"parameters": {
"branches": ["$params.target", "$params.with", "$params.without"]
}
},
{
"type": "assert-existence",
"parameters": {
"branches": ["$params.with"],
"shouldExist": true
}
},
{
"id": "get-upstream",
"type": "get-upstream",
"parameters": {
"target": "$params.target"
}
},
{
"id": "filtered-upstream",
"type": "filter-branches",
"parameters": {
"include": ["$actions['get-upstream'].outputs", "$params.with"],
"exclude": ["$params.without"]
}
},
{
"id": "simplify-upstream",
"type": "simplify-upstream",
"parameters": {
"upstreamBranches": ["$actions['filtered-upstream'].outputs"]
}
},
{
"id": "updated-status",
"type": "upstreams-updated",
"parameters": {
"recurse": true,
"branches": ["$actions['simplify-upstream'].outputs"]
}
},
{
"type": "add-diagnostic",
"condition": "$actions['updated-status'].outputs['noUpstreams'].Count -gt 0",
"parameters": {
"isWarning": "$params.allowNoUpstreams ? $false : $true",
"message": "The following branches have no upstreams:\n$(($actions['updated-status'].outputs['noUpstreams'] | ForEach-Object { \"- $_\" }) -join \"\n\")"
}
},
{
"type": "add-diagnostic",
"condition": "$actions['updated-status'].outputs['needsUpdate'].Keys.Count -gt 0",
"parameters": {
"isWarning": "$params.allowOutOfDate ? $false : $true",
"message": "The following branches are missing commits from their upstreams:\n$(($actions['updated-status'].outputs['needsUpdate'].Keys | ForEach-Object { \"- $_\" }) -join \"\n\")"
}
},
{
"id": "set-upstream",
"type": "set-upstream",
"parameters": {
"upstreamBranches": {
"$params.target": ["$actions['simplify-upstream'].outputs"]
},
"message": "Revise branch $($params.target)$($params.comment ? \" for $($params.comment)\" : '')"
}
},
{
"id": "create-branch",
"type": "merge-branches",
"parameters": {
"upstreamBranches": ["$actions['simplify-upstream'].outputs"],
"mergeMessageTemplate": "Merge '{}' for creation of $($params.target)",
"errorOnFailure": true
}
}
],
"finalize": [
{
"type": "set-branches",
"parameters": {
"force": true,
"branches": {
"$config.upstreamBranch": "$actions['set-upstream'].outputs['commit']",
"$params.target": "$actions['create-branch'].outputs['commit']"
}
}
},
{
"type": "track",
"parameters": {
"branches": ["$params.target"],
"createIfNotTracked": true
}
}
],
"output": [
"Recreated branch '$($params.target)'"
]
}