Skip to content

Instantly share code, notes, and snippets.

@Novakov
Created February 24, 2016 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Novakov/f466d8104cbd76d22516 to your computer and use it in GitHub Desktop.
Save Novakov/f466d8104cbd76d22516 to your computer and use it in GitHub Desktop.
package test;
import java.io.IOException;
import org.kohsuke.github.GHCommitState;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.GitHub;
public class Program {
public static void main(String[] args) throws IOException {
String hash = "5c95c2264419487556af894e9338214354e8057a";
String targetUrl = "http://my-jenkins";
String description = "OK!";
GitHub gh = GitHub.connectUsingOAuth("<oauth-token>");
GHRepository repo = gh.getRepository("Novakov/jenkins-github-test");
repo.createCommitStatus(hash, GHCommitState.SUCCESS, targetUrl, description, "github-commit-notify/build");
System.out.println(repo);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment