Home > sbt-gh-issues

sbt-gh-issues

Sbt-gh-issues is a project mainly written in Scala, based on the MIT license.

gh issues plugin for sbt (official/maintained repo now lives @ https://github.com/softprops/sbt-gh-issues)

sbt gh issues

plugin for github issues for those wired in to sbt

usage

This plugin adds several Github Issues related tasks to your project.

These tasks are broken down into three traits

gh.IssueTasks

gh-issues # lists open issues
gh-closed-issues # lists closed issues
gh-issue <num> # shows the details of a gh issue by number
gh-open <title> <desc> # opens a new gh issue
gh-close <num> # closes a gh issue by number
gh-search-closed-issues <term> # Search for closed gh issues by terms
gh-search-open-issues <term> # Search for open gh issues by terms

gh.LabelTasks

gh-labels # Lists a labels for the current repo
gh-add-label <label> <num> # Adds a label to a gh issue
gh-remove-label <label> <num> # Removes a label from a gh issue

gh. CommentTasks

 gh-comments <num> # lists all comments on a gh issue
 gh-comment <num> <comment> # adds a comment on a gh issue

You for simplicity you can can just mix in gh.Issues (includes all three) into your project definition.

Declare the gh issues plugin in your PluginDefinition/

> cat project/plugins/plugins.scala
import sbt._

class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
  val lessis = "less is repo" at "http://repo.lessis.me"
  val ghIssues = "me.lessis" % "gh-sbt-plugin" % "0.0.1"
}

The only dependency this plugin requires is a Github user to authenticate as an a Github repository to point at

> cat project/build/project.scala
import sbt._

class Project(info: ProjectInfo) extends DefaultProject(info) with gh.Issues {
   def ghCredentials = (<your-gh-username>, <your-gh-password>)
   def ghRepository = (<gh-user>, <gh-repo>)
}

Obviously, you will not want to check in your github username and password with your source code and push that to github :). To supply the ghCredentials tuple. You can use the LocalGhCreds function which assumes you have an externally defined .gh file containing your github username and password. This should follow the standard java properties file format

> cat path/to/home/.gh
username=your-gh-username
password=your-gh-password