jenkinsci / jenkinsci/gitlab-plugin
withCredentials() works with GitLabApiToken, but credentials() doesn't
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 615
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 10
Description
### Jenkins and plugins versions report
Follow-up to #536 and #1754
The withCredentials() syntax does work indeed in pipelines thanks to this MR, but the credentials() one doesn't.
Environment
### What Operating System are you using (both controller, and any agents involved in the problem)?
Rocky Linux 9
### Reproduction steps
Sample pipeline:
```
pipeline {
agent any
environment {
GITLAB_API_TOKEN = credentials('tokentest')
}
stages {
stage('Hello') {
steps {
echo 'Hello World'
}
}
}
}
```
### Expected Results
Token injected as GITLAB_API_TOKEN
### Actual Results
Error message:
```text
ERROR: No suitable binding handler could be found for type com.dabsquared.gitlabjenkins.connection.GitLabApiTokenImpl. Supported types are StandardUsernamePasswordCredentials,FileCredentials,DockerServerCredentials,StringCredentials,SSHUserPrivateKey.
```
### Anything else?
_No response_
### Are you interested in contributing a fix?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.