Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 24 lines (19 sloc) 0.625 kB
#!/usr/bin/env ruby
require "rubygems"
require "asana-client"
# get newly committed message
message = `git log -1 HEAD --pretty=format:%s`
commit = `git log -1 HEAD --pretty=format:%H`
Asana.init
# finishes a task: [finishes #1234567890] or [fixes #1234567890]
# comment on a task without finishing: [#1234567890]
annotations = message.scan /\[(\w+)?\s*#(\d{10,})\]/
annotations.each do |state, task_id|
case state
when /^(?:fix|finish)/i
# change task state if indicating fix/finish
Asana::Task.finish task_id
end
# always comment on the task
Asana::Task.comment task_id, "#{commit}\n\n#{message}"
end
Jump to Line
Something went wrong with that request. Please try again.