lib/bubbler_ruby/api.rb in bubbler_ruby-0.1.1 vs lib/bubbler_ruby/api.rb in bubbler_ruby-0.1.2

- old
+ new

@@ -35,12 +35,19 @@ def self.circleci_body(simplecov_results) { branch: ENV['CIRCLE_BRANCH'], commit_sha: ENV['CIRCLE_SHA1'], slug: circle_slug, - pr: ENV['CIRCLE_PR_NUMBER'], + pr: circleci_pr_number, results: simplecov_results } + end + + # CIRCLE_PR_NUMBER=2 (Only populated on forked PRs) + # CIRCLE_PULL_REQUEST= https://github.com/mark579/pull/2 + def self.circleci_pr_number + return ENV['CIRCLE_PR_NUMBER'] if ENV['CIRCLE_PR_NUMBER'] + return ENV['CIRCLE_PULL_REQUEST'].split('/').last end # CIRCLE_PROJECT_REPONAME=rails-bubbler-test # CIRCLE_PROJECT_USERNAME=mark579 # CIRCLE_REPOSITORY_URL=git@github.com:mark579/rails-bubbler-test.git