Skip to content

Instantly share code, notes, and snippets.

@clstokes
Created January 7, 2013 06:41
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 clstokes/4472989 to your computer and use it in GitHub Desktop.
Save clstokes/4472989 to your computer and use it in GitHub Desktop.
Groovy script for the Jenkins Script Console to GitHub repositories. Will throw exceptions for builds with other trigger types.
import hudson.model.*
import hudson.triggers.*
import com.cloudbees.jenkins.GitHubTrigger
for(item in Hudson.instance.items) {
println item.name
item.triggers.each{ k,v ->
((GitHubTrigger)v).getGitHubRepositories().each{
println it
}
}
println ''
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment