cloud-platform-repository-checker 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f05e40d9433c30d78cd29862228c8b3da6fa23cc57390595ecc9bd8e389d73d
4
- data.tar.gz: 567a2f1ff63266369bd6aabca971ff679b1021af6766228e19ab825fe34aa7ad
3
+ metadata.gz: 349475811494cf5ed087f35cdc0a24f1ef623aed8c35460755795d4dc2d4b3ce
4
+ data.tar.gz: 6ccc18f29bdc90fcf4f5e3f3bdbbf8f2a4a12e6d4b0591de47ceeeeae86179d1
5
5
  SHA512:
6
- metadata.gz: c72bc3a0990b27069e130ff6a7469779449e5893c51d1be1671a0057262a56e2ef45952e174c5787ee4131ee296a8f67e556a693500c411828c9e9bc8c81b9d9
7
- data.tar.gz: 9af549c15131b5914b0691ebebc0d3eff7c3dbccbb2aa8480717a9d68c6f31f7fcab037ca55764a5d8bc76b6c557cf9c8f1ec96dc964f6dfe03be24e4b7d050e
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")
@@ -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
- all_checks_result.values.all? ? PASS : FAIL
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.3.0
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-23 00:00:00.000000000 Z
11
+ date: 2020-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit