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

Unable to load gitea credentials in pipeline through withCredentials

    • 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
       

       

          [JENKINS-63006] Unable to load gitea credentials in pipeline through withCredentials

          Syed Hassan added a comment -

          facing same issue

          Syed Hassan added a comment - facing same issue

          Jimmy Praet added a comment -

          +1. Any workarounds to access the token another way from the build pipeline?

          Jimmy Praet added a comment - +1. Any workarounds to access the token another way from the build pipeline?

          Still facing the issue. Is there a workaround?

          Denis Speranskiy added a comment - Still facing the issue. Is there a workaround?

          Steven added a comment -

          Steven added a comment - Hey everyone. I'm afraid there is no workaround at the moment. It seems related to https://issues.jenkins.io/browse/JENKINS-47533?focusedCommentId=422809&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-422809

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

              Created:
              Updated: