Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63006

Unable to load gitea credentials in pipeline through withCredentials

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • gitea-plugin
    • 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
       

       

            Unassigned Unassigned
            mattiasbpersson Mattias Persson
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: