We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 649bc0d commit d3674ffCopy full SHA for d3674ff
pipeline-examples/github-org-plugin/access-repo-information.groovy
@@ -1,6 +1,10 @@
1
#!groovy
2
3
// 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
8
tokens = "${env.JOB_NAME}".tokenize('/')
9
org = tokens[tokens.size()-3]
10
repo = tokens[tokens.size()-2]
0 commit comments