fastlane-plugin-github_job_status 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 8dcaeb672cdc93fd6347f2797e5299d7ccc35a20
4
- data.tar.gz: 1d29eef826898a7e33ca395df046468ae84c8da2
3
+ metadata.gz: 9c5bd3ffe0f1564eb685b23076eb4ff7cf02ad6b
4
+ data.tar.gz: 39d8df5b92eb2821e4b00d94269c879dfd99f092
5
5
  SHA512:
6
- metadata.gz: 6a7854e0a4c2ced8ce0ed212a713eed33f4c2dc0217976f55440e8c760bdc5aa1b63ed1c3b9bdee02dc4c421560cfd80f50e13d7cb09e0104ecb85b374cd5262
7
- data.tar.gz: 90b5393ce01eb0e49442aaaa68da16ed4fc23a65200bb432b82240da127b6e9e2002f095c2f265f779b2c4b331bb59cf9e294455b2f567a2f29b079624007fbc
6
+ metadata.gz: b49cd4717e9c88582b65711b993df83bf8d583ee846f1e1c326ff6faebfcc092bb7d948f85f4ed40976e2999da81d9013da6556eff0d882dc82ba4e5740b6085
7
+ data.tar.gz: 47dcf767220736705b285f91b4da869d28b7891db084f5277909832fc921378be0573ea64caa503ffa230e3d66bbe5e8e59ddf5a4bcf1447e0213e33120a81bb
data/README.md CHANGED
@@ -30,9 +30,10 @@ github_job_status(
30
30
  )
31
31
  ```
32
32
 
33
+ * `token` can be obtained in GitHub for an owner (To do this, go to settings/Personal access tokens. Generate a new token and be sure to enable `repo:status`.)
33
34
  * `state` must be pending, success, error, or failure
34
- * `token` can be obtained in GitHub for an owner (To do this, go to settings/Personal access tokens. Generate a new token and be sure to enable `repo:status`.)
35
- * `job_name`, `description` and `build_url` are optional, but all other parameters are required
35
+ * `sha` is optional, and the default value is the last commit hash (thanks to [last_git_commit](https://docs.fastlane.tools/actions/#last_git_commit))
36
+ * `job_name`, `description` and `build_url` are optional
36
37
 
37
38
  ## Example
38
39
 
@@ -5,7 +5,9 @@ module Fastlane
5
5
 
6
6
  def self.run(params)
7
7
  api = "https://api.github.com/repos"
8
- url = "#{api}/#{params[:owner]}/#{params[:repo]}/statuses/#{params[:sha]}"
8
+ # if sha not provided then use last_commit
9
+ sha = !params[:sha] ? Fastlane::Actions.last_git_commit_dict[:commit_hash] : params[:sha]
10
+ url = "#{api}/#{params[:owner]}/#{params[:repo]}/statuses/#{sha}"
9
11
 
10
12
  headers = {
11
13
  'Authorization' => "token #{params[:token]}",
@@ -89,7 +91,7 @@ module Fastlane
89
91
  key: :sha,
90
92
  env_name: 'GITHUB_JOB_STATUS_SHA',
91
93
  description: 'The github sha of the commit',
92
- verify_block: proc { |value| UI.user_error! "SHA must be specified" if value.empty? }
94
+ optional: true
93
95
  ),
94
96
  FastlaneCore::ConfigItem.new(
95
97
  key: :job_name,
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module GithubJobStatus
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-github_job_status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Singer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-23 00:00:00.000000000 Z
11
+ date: 2017-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client