File tree Expand file tree Collapse file tree
src/main/java/com/cloudbees/jenkins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,12 +145,14 @@ public void doIndex(StaplerRequest req) {
145145 JSONObject o = JSONObject .fromObject (req .getParameter ("payload" ));
146146 JSONObject repository = o .getJSONObject ("repository" );
147147 String repoUrl = repository .getString ("url" ); // something like 'https://github.com/kohsuke/foo'
148+ String repoName = repository .getString ("name" ); // 'foo' portion of the above URL
149+ String ownerName = repository .getJSONObject ("owner" ).getString ("name" ); // 'kohsuke' portion of the above URL
148150
149151 LOGGER .info ("Received POST for " +repoUrl );
150152 LOGGER .fine ("Full details of the POST was " +o .toString ());
151153 Matcher matcher = REPOSITORY_NAME_PATTERN .matcher (repoUrl );
152154 if (matcher .matches ()) {
153- GitHubRepositoryName changedRepository = new GitHubRepositoryName (matcher .group (1 ),matcher . group ( 2 ), matcher . group ( 3 ) );
155+ GitHubRepositoryName changedRepository = new GitHubRepositoryName (matcher .group (1 ), ownerName , repoName );
154156 for (AbstractProject <?,?> job : Hudson .getInstance ().getItems (AbstractProject .class )) {
155157 GitHubPushTrigger trigger = job .getTrigger (GitHubPushTrigger .class );
156158 if (trigger !=null ) {
You can’t perform that action at this time.
0 commit comments