-
-
Save frezbo/67410eea49aa896e73d12c8525bf45a9 to your computer and use it in GitHub Desktop.
Configure GitHub Pull Request Builder Jenkins plugin with Groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ghprb 1.29.2 | |
import java.lang.reflect.Field | |
import jenkins.model.* | |
import org.jenkinsci.plugins.ghprb.* | |
def descriptor = Jenkins.instance.getDescriptorByType(org.jenkinsci.plugins.ghprb.GhprbTrigger.DescriptorImpl.class) | |
Field auth = descriptor.class.getDeclaredField("githubAuth") | |
auth.setAccessible(true) | |
githubAuth = new ArrayList<GhprbGitHubAuth>(1) | |
githubAuth.add(new GhprbGitHubAuth("https://api.github.com", "aebe0886-5ead-47cd-9a13-18490b7a2831", "test1", "d1e9f1cb-c1e0-42f6-b3d9-6ccca25729ab", null)) | |
githubAuth.add(new GhprbGitHubAuth("https://api.github.com", "3ebe0886-5ead-47cd-9a13-18490b7a2831", "test2", "31e9f1cb-c1e0-42f6-b3d9-6ccca25729ab", null)) | |
auth.set(descriptor, githubAuth) | |
descriptor.save() | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment