Skip to content

Commit d3674ff

Browse files
authored
Update access-repo-information.groovy
Added description
1 parent 649bc0d commit d3674ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!groovy
22

33
// github-organization-plugin jobs are named as 'org/repo/branch'
4+
// we don't want to assume that the github-organization job is at the top-level
5+
// instead we get the total number of tokens (size)
6+
// and work back from the branch level Pipeline job where this would actually be run
7+
// Note: that branch job is at -1 because Java uses zero-based indexing
48
tokens = "${env.JOB_NAME}".tokenize('/')
59
org = tokens[tokens.size()-3]
610
repo = tokens[tokens.size()-2]

0 commit comments

Comments
 (0)