Skip to content

Commit 86c1b5e

Browse files
committed
Enteprise sourcetype rulesets should not be handled at the org level
1 parent 0a58005 commit 86c1b5e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/plugins/rulesets.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@ module.exports = class Rulesets extends Diffable {
3030
return this.github.paginate(listOptions)
3131
.then(res => {
3232
const rulesets = res.map(ruleset => {
33-
const getOptions = this.github.request.endpoint.merge('GET /orgs/{org}/rulesets/{id}', {
34-
org: this.repo.owner,
35-
id: ruleset.id,
36-
headers: version
37-
})
38-
return this.github.paginate(getOptions)
33+
if (ruleset.source_type === 'Organization') {
34+
const getOptions = this.github.request.endpoint.merge('GET /orgs/{org}/rulesets/{id}', {
35+
org: this.repo.owner,
36+
id: ruleset.id,
37+
headers: version
38+
})
39+
return this.github.paginate(getOptions)
40+
} else {
41+
return Promise.resolve([])
42+
}
3943
})
4044
return Promise.all(rulesets).then(res => {
4145
return res ? res.flat(1) : []

0 commit comments

Comments
 (0)