Skip to content

Instantly share code, notes, and snippets.

@eputnam
Created January 6, 2017 18:26
Show Gist options
  • Save eputnam/0f0d9ec56a46bf307c3b90eccc17e311 to your computer and use it in GitHub Desktop.
Save eputnam/0f0d9ec56a46bf307c3b90eccc17e311 to your computer and use it in GitHub Desktop.
gitbadge.rb
#!/usr/bin/env ruby
#Creates sweet github badges to insert into JIRA tickets for PRs
#Usage:
# gitbadge https://github.com/puppetlabs/puppetlabs-acl/pull/90 https://github-shields.com/github/puppetlabs/puppetlabs-apache/pull/324.svg
url = ARGV
badges = []
url.each do |u|
s = u.split('.com')
s[0] += "-shields.com/github"
s[1] += ".svg"
final_badge = "[!#{s.join}!|#{u}]"
badges.push final_badge
end
puts badges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment