Commit Status Publisher in Kotlin DSL

Hi there!

I follow the example in the TeamCity Kotlin API to add a Commit Status Publisher to my build config. The VCS Root was set up with a GitHub connection. The connections works and now I would like to use reuse the access token of this connection for Commit Status Publisher. 

Here the example from the docs:

buildType {
    // Other Build Type settings ...
    features {
        // Other Build Features ...
        commitStatusPublisher {
          vcsRootExtId = "${<VCS root object>.id}" // A VCS root must be specified to use this authentication type
          publisher = github {
            githubUrl = "<GitHub URL, https://api.github.com for github.com>"
            authType = storedToken {
              tokenId = "tc_token_id:*****"
            }
          }
        }    }
}


I wonder where to find the `tokenId` in this case. Where can I find the token id of a GitHub connection?

0
1 comment

Hi Hirt,

You can obtain the token ID using the TeamCity VCS REST API. For more detailed information, please refer to the following link: https://www.jetbrains.com/help/teamcity/rest/manage-vcs-roots.html#List+VCS+Roots

http(s)://{TeamCity Server}:{port}/app/rest/vcs-roots/id:{VCS Id}
0

Please sign in to leave a comment.