Skip to content

Commit

Permalink
Merge pull request #35 from recena/JENKINS-33815
Browse files Browse the repository at this point in the history
Validation for GH Organizations and GH User Accounts
  • Loading branch information
recena committed Mar 25, 2016
2 parents eb2b060 + 13dbeef commit 3425908
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -27,22 +27,19 @@
import com.cloudbees.plugins.credentials.CredentialsNameProvider;
import com.cloudbees.plugins.credentials.common.StandardCredentials;
import com.cloudbees.plugins.credentials.common.StandardListBoxModel;
import hudson.AbortException;
import hudson.Extension;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.Util;
import hudson.model.TaskListener;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import java.io.IOException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import javax.annotation.CheckForNull;
import jenkins.scm.api.SCMNavigator;
import jenkins.scm.api.SCMNavigatorDescriptor;
import jenkins.scm.api.SCMSource;
import jenkins.scm.api.SCMSourceObserver;
import jenkins.scm.api.SCMSourceOwner;
import org.kohsuke.accmod.Restricted;
Expand Down Expand Up @@ -167,7 +164,10 @@ public String getApiUri() {
for (GHRepository repo : user.listRepositories()) {
add(listener, observer, repo);
}
return;
}

throw new AbortException(repoOwner + " does not correspond to a known GitHub User Account or Organization");
}

private void add(TaskListener listener, SCMSourceObserver observer, GHRepository repo) throws InterruptedException {
Expand Down

0 comments on commit 3425908

Please sign in to comment.