-
Bug
-
Resolution: Unresolved
-
Major
-
None
It's not possible to use withCredentials in a jenkins pipeline to load the credentials setup for gitea-plugin.
The credentials are working as they should. It's just the following that isn't possible:
Pipeline:
environment {
GITEA_TOKEN = credentials('gitea-credentials')
}
Result:
ERROR: No suitable binding handler could be found for type org.jenkinsci.plugin.gitea.credentials.PersonalAccessTokenImpl. Supported types are StandardUsernamePasswordCredentials,FileCredentials,StringCredentials,DockerServerCredentials,SSHUserPrivateKey.
Pipeline:
withCredentials([[$class: "org.jenkinsci.plugin.gitea.credentials.PersonalAccessTokenImpl", credentialsId: 'gitea-credentials', variable: 'token']])
Result:
java.lang.ClassCastException: org.jenkinsci.plugin.gitea.credentials.PersonalAccessTokenImpl cannot be cast to org.jenkinsci.plugins.credentialsbinding.MultiBinding
[JENKINS-63006] Unable to load gitea credentials in pipeline through withCredentials
Description |
Original:
It's not possible to use withCredentials in a jenkins pipeline to load the credentials setup for gitea-plugin. {{The credentials are working as they should. It's just the following that isn't possible:}} {{environment {}} {{ GITEA_TOKEN = credentials('gitea-credentials')}} {{ }}} {{}} ERROR: No suitable binding handler could be found for type org.jenkinsci.plugin.gitea.credentials.PersonalAccessTokenImpl. Supported types are StandardUsernamePasswordCredentials,FileCredentials,StringCredentials,DockerServerCredentials,SSHUserPrivateKey. {{withCredentials([[$class: "org.jenkinsci.plugin.gitea.credentials.PersonalAccessTokenImpl", credentialsId: 'gitea-credentials', variable: 'token']])}} {{}} java.lang.ClassCastException: org.jenkinsci.plugin.gitea.credentials.PersonalAccessTokenImpl cannot be cast to org.jenkinsci.plugins.credentialsbinding.MultiBinding |
New:
It's not possible to use withCredentials in a jenkins pipeline to load the credentials setup for gitea-plugin. {{The credentials are working as they should. It's just the following that isn't possible:}} Pipeline: {{environment {}} {{ GITEA_TOKEN = credentials('gitea-credentials')}} } Result: ERROR: No suitable binding handler could be found for type org.jenkinsci.plugin.gitea.credentials.PersonalAccessTokenImpl. Supported types are StandardUsernamePasswordCredentials,FileCredentials,StringCredentials,DockerServerCredentials,SSHUserPrivateKey. Pipeline: {{withCredentials([[$class: "org.jenkinsci.plugin.gitea.credentials.PersonalAccessTokenImpl", credentialsId: 'gitea-credentials', variable: 'token']])}} Result: java.lang.ClassCastException: org.jenkinsci.plugin.gitea.credentials.PersonalAccessTokenImpl cannot be cast to org.jenkinsci.plugins.credentialsbinding.MultiBinding |
Priority | Original: Minor [ 4 ] | New: Major [ 3 ] |
facing same issue