Skip to content

Commit 649bc0d

Browse files
authored
Update access-repo-information.groovy
The GitHub Org Folder job may not be created at the Jenkins master top-level. Using the tokens list size and walking back from there will always provide the correct index for org, repo, and branch.
1 parent 291ebcd commit 649bc0d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pipeline-examples/github-org-plugin/access-repo-information.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// github-organization-plugin jobs are named as 'org/repo/branch'
44
tokens = "${env.JOB_NAME}".tokenize('/')
5-
org = tokens[0]
6-
repo = tokens[1]
7-
branch = tokens[2]
5+
org = tokens[tokens.size()-3]
6+
repo = tokens[tokens.size()-2]
7+
branch = tokens[tokens.size()-1]
88

0 commit comments

Comments
 (0)