@repository-settings/app 3.0.8 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/plugins/environments.js +18 -4
- package/package.json +11 -11
|
@@ -38,7 +38,9 @@ function deploymentBranchPolicyToString (attrs) {
|
|
|
38
38
|
return JSON.stringify(
|
|
39
39
|
shouldUseProtectedBranches(attrs.protected_branches, attrs.custom_branches)
|
|
40
40
|
? { protected_branches: true }
|
|
41
|
-
: {
|
|
41
|
+
: {
|
|
42
|
+
custom_branches: attrs.custom_branches.sort((a, b) => JSON.stringify(a).localeCompare(JSON.stringify(b)))
|
|
43
|
+
}
|
|
42
44
|
)
|
|
43
45
|
}
|
|
44
46
|
}
|
|
@@ -66,6 +68,14 @@ module.exports = class Environments extends Diffable {
|
|
|
66
68
|
// Force all names to lowercase to avoid comparison issues.
|
|
67
69
|
this.entries.forEach(environment => {
|
|
68
70
|
environment.name = environment.name.toLowerCase()
|
|
71
|
+
if (environment.deployment_branch_policy && environment.deployment_branch_policy.custom_branches) {
|
|
72
|
+
environment.deployment_branch_policy.custom_branches = environment.deployment_branch_policy.custom_branches.map(
|
|
73
|
+
rule => ({
|
|
74
|
+
name: rule.name || rule,
|
|
75
|
+
type: rule.type || 'branch'
|
|
76
|
+
})
|
|
77
|
+
)
|
|
78
|
+
}
|
|
69
79
|
})
|
|
70
80
|
}
|
|
71
81
|
}
|
|
@@ -88,7 +98,10 @@ module.exports = class Environments extends Diffable {
|
|
|
88
98
|
environment.name
|
|
89
99
|
)
|
|
90
100
|
environment.deployment_branch_policy = {
|
|
91
|
-
custom_branches: branchPolicies.map(_ =>
|
|
101
|
+
custom_branches: branchPolicies.map(_ => ({
|
|
102
|
+
name: _.name,
|
|
103
|
+
type: _.type
|
|
104
|
+
}))
|
|
92
105
|
}
|
|
93
106
|
} else {
|
|
94
107
|
environment.deployment_branch_policy = {
|
|
@@ -147,12 +160,13 @@ module.exports = class Environments extends Diffable {
|
|
|
147
160
|
|
|
148
161
|
if (attrs.deployment_branch_policy && attrs.deployment_branch_policy.custom_branches) {
|
|
149
162
|
await Promise.all(
|
|
150
|
-
attrs.deployment_branch_policy.custom_branches.map(
|
|
163
|
+
attrs.deployment_branch_policy.custom_branches.map(rule =>
|
|
151
164
|
this.github.request('POST /repos/:org/:repo/environments/:environment_name/deployment-branch-policies', {
|
|
152
165
|
org: this.repo.owner,
|
|
153
166
|
repo: this.repo.repo,
|
|
154
167
|
environment_name: attrs.name,
|
|
155
|
-
name
|
|
168
|
+
name: rule.name,
|
|
169
|
+
type: rule.type
|
|
156
170
|
})
|
|
157
171
|
)
|
|
158
172
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repository-settings/app",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Pull Requests for GitHub repository settings",
|
|
5
5
|
"repository": "github:repository-settings/app",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,22 +29,22 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"deepmerge": "4.3.1",
|
|
31
31
|
"js-yaml": "4.1.0",
|
|
32
|
-
"probot": "13.
|
|
32
|
+
"probot": "13.3.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@cucumber/cucumber": "10.
|
|
35
|
+
"@cucumber/cucumber": "10.8.0",
|
|
36
36
|
"@form8ion/remark-preset": "1.0.2",
|
|
37
|
-
"@travi/any": "3.1.
|
|
37
|
+
"@travi/any": "3.1.2",
|
|
38
38
|
"http-status-codes": "2.3.0",
|
|
39
39
|
"jest": "29.7.0",
|
|
40
40
|
"jest-when": "3.6.0",
|
|
41
|
-
"lockfile-lint": "4.
|
|
42
|
-
"ls-engines": "0.9.
|
|
43
|
-
"msw": "2.
|
|
44
|
-
"nodemon": "3.1.
|
|
45
|
-
"npm-run-all2": "6.
|
|
41
|
+
"lockfile-lint": "4.14.0",
|
|
42
|
+
"ls-engines": "0.9.2",
|
|
43
|
+
"msw": "2.3.1",
|
|
44
|
+
"nodemon": "3.1.4",
|
|
45
|
+
"npm-run-all2": "6.2.0",
|
|
46
46
|
"prettier-standard": "16.4.1",
|
|
47
|
-
"publint": "0.2.
|
|
47
|
+
"publint": "0.2.8",
|
|
48
48
|
"smee-client": "2.0.1",
|
|
49
49
|
"standard": "17.1.0"
|
|
50
50
|
},
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"access": "public",
|
|
75
75
|
"provenance": true
|
|
76
76
|
},
|
|
77
|
-
"packageManager": "npm@10.
|
|
77
|
+
"packageManager": "npm@10.8.1"
|
|
78
78
|
}
|