cloud-platform-repository-checker 1.0.3 → 1.0.4
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.
- checksums.yaml +4 -4
- data/lib/repository_lister.rb +1 -1
- data/lib/repository_report.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60d229973369bc0c5340def8a8e75649c381264b514ed62621c1e035dbde224e
|
4
|
+
data.tar.gz: d881956db6b61be7f794869f983cab1658a4c90437a6567467d251a86aa28961
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a893a66211f292b3058e6715d6ecb0bd93b2c54217978a6a1eec6b25ff57913fe2c7747671c0a3f936b6af7cbebd2b41fb51f8ada5b7cc56f624c94f6b9181ea
|
7
|
+
data.tar.gz: 8bb942f8268191031e92640492d0a9e4c5e99947bf73afacf1e86b5aa6a745a203b18035a4aec777dc657c7f3bd243f04b92b8944c4165347b756b0bad8c764b
|
data/lib/repository_lister.rb
CHANGED
@@ -12,7 +12,7 @@ class RepositoryLister < GithubGraphQlClient
|
|
12
12
|
# Returns a list of repository names which match `regexp`
|
13
13
|
def repository_names
|
14
14
|
list_repos
|
15
|
-
.
|
15
|
+
.select { |repo| repo["name"] =~ regexp }
|
16
16
|
.map { |repo| repo["name"] }
|
17
17
|
end
|
18
18
|
|
data/lib/repository_report.rb
CHANGED
@@ -101,7 +101,7 @@ class RepositoryReport < GithubGraphQlClient
|
|
101
101
|
def is_team_admin?
|
102
102
|
client = Octokit::Client.new(access_token: github_token)
|
103
103
|
|
104
|
-
client.repo_teams([organization, repo_name].join("/")).
|
104
|
+
client.repo_teams([organization, repo_name].join("/")).select do |team|
|
105
105
|
team[:name] == team && team[:permission] == ADMIN
|
106
106
|
end.any?
|
107
107
|
rescue Octokit::NotFound
|
@@ -117,7 +117,7 @@ class RepositoryReport < GithubGraphQlClient
|
|
117
117
|
requiring_branch_protection_rules do |rules|
|
118
118
|
|
119
119
|
rules
|
120
|
-
.
|
120
|
+
.select { |edge| edge.dig("node", "pattern") == MASTER }
|
121
121
|
.any?
|
122
122
|
end
|
123
123
|
end
|