@repository-settings/app 4.0.3 → 4.1.1
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/index.js +1 -3
- package/lib/plugins/rulesets.js +31 -0
- package/lib/settings.js +3 -1
- package/package.json +7 -6
package/index.js
CHANGED
|
@@ -46,7 +46,5 @@ export default (robot, _, Settings = SettingsApp) => {
|
|
|
46
46
|
return syncSettings(context)
|
|
47
47
|
})
|
|
48
48
|
|
|
49
|
-
robot.on('repository.created', async context =>
|
|
50
|
-
return syncSettings(context)
|
|
51
|
-
})
|
|
49
|
+
robot.on('repository.created', async context => syncSettings(context))
|
|
52
50
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import deepEqual from 'deep-equal'
|
|
2
|
+
|
|
3
|
+
import Diffable from './diffable.js'
|
|
4
|
+
|
|
5
|
+
export default class Rulesets extends Diffable {
|
|
6
|
+
async find () {
|
|
7
|
+
const { data: rulesets } = await this.github.repos.getRepoRulesets(this.repo)
|
|
8
|
+
|
|
9
|
+
return rulesets
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
comparator (existing, attrs) {
|
|
13
|
+
return existing.name === attrs.name
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
changed (existing, attrs) {
|
|
17
|
+
return !deepEqual(existing, attrs)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
update (existing, attrs) {
|
|
21
|
+
return this.github.repos.updateRepoRuleset({ ...this.repo, ruleset_id: existing.ruleset_id, ...attrs })
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
remove (existing) {
|
|
25
|
+
return this.github.repos.deleteRepoRuleset({ ...this.repo, ruleset_id: existing.ruleset_id })
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async add (attrs) {
|
|
29
|
+
await this.github.repos.createRepoRuleset({ ...this.repo, ...attrs })
|
|
30
|
+
}
|
|
31
|
+
}
|
package/lib/settings.js
CHANGED
|
@@ -5,6 +5,7 @@ import Teams from './plugins/teams.js'
|
|
|
5
5
|
import Milestones from './plugins/milestones.js'
|
|
6
6
|
import Branches from './plugins/branches.js'
|
|
7
7
|
import Environments from './plugins/environments.js'
|
|
8
|
+
import Rulesets from './plugins/rulesets.js'
|
|
8
9
|
|
|
9
10
|
export default class Settings {
|
|
10
11
|
static sync (github, repo, config) {
|
|
@@ -49,5 +50,6 @@ Settings.PLUGINS = {
|
|
|
49
50
|
teams: Teams,
|
|
50
51
|
milestones: Milestones,
|
|
51
52
|
branches: Branches,
|
|
52
|
-
environments: Environments
|
|
53
|
+
environments: Environments,
|
|
54
|
+
rulesets: Rulesets
|
|
53
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repository-settings/app",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Pull Requests for GitHub repository settings",
|
|
5
5
|
"repository": "github:repository-settings/app",
|
|
6
6
|
"type": "module",
|
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
"author": "Brandon Keepers",
|
|
30
30
|
"license": "ISC",
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"deep-equal": "2.2.3",
|
|
32
33
|
"deepmerge": "4.3.1",
|
|
33
34
|
"js-yaml": "4.1.0",
|
|
34
35
|
"probot": "13.3.7"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@cucumber/cucumber": "11.0.
|
|
38
|
+
"@cucumber/cucumber": "11.0.1",
|
|
38
39
|
"@form8ion/remark-preset": "1.0.3",
|
|
39
40
|
"@travi/any": "3.1.2",
|
|
40
41
|
"http-status-codes": "2.3.0",
|
|
@@ -42,13 +43,13 @@
|
|
|
42
43
|
"jest-when": "3.6.0",
|
|
43
44
|
"lockfile-lint": "4.14.0",
|
|
44
45
|
"ls-engines": "0.9.3",
|
|
45
|
-
"msw": "2.4.
|
|
46
|
+
"msw": "2.4.8",
|
|
46
47
|
"nodemon": "3.1.4",
|
|
47
|
-
"npm-run-all2": "6.2.
|
|
48
|
+
"npm-run-all2": "6.2.3",
|
|
48
49
|
"prettier-standard": "16.4.1",
|
|
49
|
-
"publint": "0.2.
|
|
50
|
+
"publint": "0.2.11",
|
|
50
51
|
"smee-client": "2.0.3",
|
|
51
|
-
"standard": "17.1.
|
|
52
|
+
"standard": "17.1.2"
|
|
52
53
|
},
|
|
53
54
|
"standard": {
|
|
54
55
|
"env": [
|