cloud-platform-repository-checker 1.3.0 → 1.4.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.
- checksums.yaml +4 -4
- data/bin/cloud-platform-repository-checker +7 -0
- data/lib/repository_report.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 349475811494cf5ed087f35cdc0a24f1ef623aed8c35460755795d4dc2d4b3ce
|
4
|
+
data.tar.gz: 6ccc18f29bdc90fcf4f5e3f3bdbbf8f2a4a12e6d4b0591de47ceeeeae86179d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 816eb3fa94959c00289745126c149fde28b7b857cc8c106636a0c61b18f91b1cd4291ec8b9c9aed72ad5d91b797b08879dd6e4d0a92bb257b093fc2105d013f1
|
7
|
+
data.tar.gz: fe518adc7d36d267ae86a48e1183e9b6194a325d98e21e839f87bd516cbb7b85ece38fb8c05cbd2899055ff445d3d7fbc5f58b74e6b8cfbad3ba592534a64283
|
@@ -16,8 +16,15 @@ require_relative "../lib/repository_report"
|
|
16
16
|
|
17
17
|
############################################################
|
18
18
|
|
19
|
+
# Exceptions are repos which are allowed to break the rules.
|
20
|
+
# e.g. a repo to which compiled html files for a github pages
|
21
|
+
# site can't implement branch protection, but we don't want it
|
22
|
+
# to show up as an error
|
23
|
+
exceptions = ENV["REPO_EXCEPTIONS"].to_s.split(" ")
|
24
|
+
|
19
25
|
params = {
|
20
26
|
organization: ENV.fetch("ORGANIZATION"),
|
27
|
+
exceptions: exceptions,
|
21
28
|
regexp: Regexp.new(ENV.fetch("REGEXP")),
|
22
29
|
team: ENV.fetch("TEAM"),
|
23
30
|
github_token: ENV.fetch("GITHUB_TOKEN")
|
data/lib/repository_report.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class RepositoryReport < GithubGraphQlClient
|
2
|
-
attr_reader :organization, :repo_name, :team
|
2
|
+
attr_reader :organization, :exceptions, :repo_name, :team
|
3
3
|
|
4
4
|
MAIN_BRANCH = "main"
|
5
5
|
ADMIN = "admin"
|
@@ -8,6 +8,7 @@ class RepositoryReport < GithubGraphQlClient
|
|
8
8
|
|
9
9
|
def initialize(params)
|
10
10
|
@organization = params.fetch(:organization)
|
11
|
+
@exceptions = params.fetch(:exceptions) # repos which are allowed to break the rules
|
11
12
|
@repo_name = params.fetch(:repo_name)
|
12
13
|
@team = params.fetch(:team)
|
13
14
|
super(params)
|
@@ -41,7 +42,11 @@ class RepositoryReport < GithubGraphQlClient
|
|
41
42
|
end
|
42
43
|
|
43
44
|
def status
|
44
|
-
|
45
|
+
if exceptions.include?(repo_name)
|
46
|
+
PASS
|
47
|
+
else
|
48
|
+
all_checks_result.values.all? ? PASS : FAIL
|
49
|
+
end
|
45
50
|
end
|
46
51
|
|
47
52
|
def all_checks_result
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud-platform-repository-checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Salgado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|