concourse-github-status 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/github-status/check.rb +2 -2
- data/lib/github-status/in.rb +7 -2
- data/lib/github-status/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef4594ecf08ea6ef9c9318268072156e2c1bd79d
|
4
|
+
data.tar.gz: e2a6a1380658c2068274d86e4844b0bf53889025
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03b93e07785664de9b4d09a767a1a229e39cb981d571892eb16578e422aa1d7a2985726cd9ebb91fbd8551faa644af9616802dcbc3f1d9e867a7b18766a51d37
|
7
|
+
data.tar.gz: 107e38a1ad904f85f59d51bb30e673e90d1e02d3597cab49bc189f48015782c40cbf747f9134a63ccecc9d1fd32fd53c256af7814683de8601720a1236056de1
|
data/lib/github-status/check.rb
CHANGED
@@ -8,7 +8,7 @@ module GitHubStatus
|
|
8
8
|
include Support::GitHub
|
9
9
|
|
10
10
|
Contract HashOf[String, String] => String
|
11
|
-
def
|
11
|
+
def sha(version)
|
12
12
|
@sha ||= version.fetch('context@sha') { commit }.split('@').last
|
13
13
|
end
|
14
14
|
|
@@ -30,7 +30,7 @@ module GitHubStatus
|
|
30
30
|
Contract HashOf[String, String] => ArrayOf[HashOf[String, String]]
|
31
31
|
def since(version)
|
32
32
|
github
|
33
|
-
.commits_since(repo, date(
|
33
|
+
.commits_since(repo, date(sha(version)))
|
34
34
|
.map { |commit| { 'context@sha' => "concourseci@#{commit[:sha]}" } }
|
35
35
|
end
|
36
36
|
end
|
data/lib/github-status/in.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'concourse-fuselage'
|
2
2
|
require 'contracts'
|
3
3
|
require_relative 'core'
|
4
|
-
require_relative 'support/git'
|
5
4
|
require_relative 'support/github'
|
6
5
|
require_relative 'support/params'
|
7
6
|
|
@@ -9,9 +8,14 @@ module GitHubStatus
|
|
9
8
|
class In < Fuselage::In
|
10
9
|
include Core
|
11
10
|
include Support::Params
|
12
|
-
include Support::Git
|
13
11
|
include Support::GitHub
|
14
12
|
|
13
|
+
Contract HashOf[String, String] => String
|
14
|
+
def sha(version)
|
15
|
+
@sha ||= version.fetch('context@sha') { commit }.split('@').last
|
16
|
+
end
|
17
|
+
|
18
|
+
Contract None => Maybe[String]
|
15
19
|
def state
|
16
20
|
github
|
17
21
|
.statuses(repo, sha)
|
@@ -20,6 +24,7 @@ module GitHubStatus
|
|
20
24
|
.first
|
21
25
|
end
|
22
26
|
|
27
|
+
Contract None => Num
|
23
28
|
def fetch!
|
24
29
|
File.write "#{workdir}/#{context}.state", state
|
25
30
|
end
|