app/cyclid/plugins/api/github/helpers.rb in cyclid-0.3.2 vs app/cyclid/plugins/api/github/helpers.rb in cyclid-0.3.3

- old
+ new

@@ -27,10 +27,14 @@ module Helpers def pull_request @pr ||= @payload['pull_request'] end + def pr_number + @pr_number ||= pull_request['number'] + end + def pr_head @pr_head ||= pull_request['head'] end def pr_base @@ -110,11 +114,11 @@ # See if a .cyclid.yml or .cyclid.json file exists in the project # root sha = nil type = nil tree['tree'].each do |file| - match = file['path'].match(/\A\.cyclid\.(json|yml)\z/) + match = file['path'].match(/\A\.cyclid\.(json|yml|yaml)\z/) next unless match sha = file['sha'] type = match[1] break @@ -125,10 +129,10 @@ def load_job_file(repo, sha, type) blob = @client.blob(repo, sha) case type when 'json' Oj.load(Base64.decode64(blob.content)) - when 'yml' + when 'yml', 'yaml' YAML.load(Base64.decode64(blob.content)) end end # Generate a "state" key that can be passed to the OAuth endpoints