concourse-github-status 0.3.1 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd85b1a8a2547b10d772f8ba43b09e38b446d460
4
- data.tar.gz: e6331a8bf4ac117a66bab93f6ed969f6011b50b2
3
+ metadata.gz: fa35a8da151545bf51314248d70f3b7113892fe1
4
+ data.tar.gz: c56cc31c6774407924fda4e8a3af52e6981242e8
5
5
  SHA512:
6
- metadata.gz: 5e7068f2e1b6b8d462532b038171904bbb9cf720d1772c70a8101d8a799b44179dd5f8c5950b3d9516060c460156552de68add49ff351d30f0a0b2df6adba330
7
- data.tar.gz: 4dc02def0f57a49e7bffbcd621ccb0070d4b499b7be354220fdc44dc9e6c653e027c869acbb1797e725c15dc75a0abaf94f514a08310d02124bc3a5fa6c2e70d
6
+ metadata.gz: 5e6c857237b928ce2bc43b47503f288d2c079d1bafb06195cbecda822ae136d577c48c13619b8ddd99814019deedfc6683be6c13140c86d072a61332acc2625e
7
+ data.tar.gz: 945a17338039877cfdfda5e72e78e933baf18cc93147d3dbbcda593f0f81a568bfbd06fa6cb060639e6e6539331e48c3a92617a239dfd85c6e684596c5b5b1e1
data/README.org CHANGED
@@ -48,7 +48,19 @@ Add the resource to your pipeline's ~resource_types~ (requires Concourse 0.74.0+
48
48
 
49
49
  - None
50
50
 
51
- ** ~in~ Not Implemented
51
+ ** ~in~ Fetch a status
52
+
53
+ *** Parameters
54
+
55
+ Fetches the state of ~context~ for the current commit of the repository at
56
+ ~path~, and write it to ~{context}.state~
57
+
58
+ |-------------+----------+-----------+--------------------------------------------|
59
+ | Name | Required | Default | Description |
60
+ |-------------+----------+-----------+--------------------------------------------|
61
+ | path | Yes | | Relative path to the repository |
62
+ | context | No | concourse | The ~context~ for the status being updated |
63
+ |-------------+----------+-----------+--------------------------------------------|
52
64
 
53
65
  * License
54
66
 
@@ -1,6 +1,27 @@
1
1
  require 'concourse-fuselage'
2
+ require 'contracts'
3
+ require_relative 'core'
4
+ require_relative 'support/git'
5
+ require_relative 'support/github'
6
+ require_relative 'support/params'
2
7
 
3
8
  module GitHubStatus
4
9
  class In < Fuselage::In
10
+ include Core
11
+ include Support::Params
12
+ include Support::Git
13
+ include Support::GitHub
14
+
15
+ def status
16
+ github
17
+ .statuses(repo, sha)
18
+ .select { |status| status.context == context }
19
+ .map(&:state)
20
+ .first
21
+ end
22
+
23
+ def fetch!
24
+ File.write "#{workdir}/#{context}.state", state
25
+ end
5
26
  end
6
27
  end
@@ -1,3 +1,3 @@
1
1
  module GitHubStatus
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concourse-github-status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Olstrom