Sha256: 7b229cdecdf440c5dd517c6dff156991bf5d12f255a082076cbb9f40d563f8f5

Contents?: true

Size: 626 Bytes

Versions: 1

Compression:

Stored size: 626 Bytes

Contents

# Example action
# Thank the person who submit an issue

class Thanks
  def initialize(settings, client, project, data)
    @settings = settings # action specific settings
    @client = client # Octokit client
    @project = project # project name
    @data = data
  end

  def run
    # Only trigger if a new issue is created
    return unless @data['action'] == 'opened'

    issue = @data['issue']['number']
    submitter = @data['issue']['user']['login']
    comment = "@#{submitter} thanks for submitting this issue!"

    puts comment # just for debug purpose
    @client.add_comment(@project, issue, comment)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tutter-0.0.1 lib/tutter/action/thanks.rb