Using multibranch pipeline plugin and credentials binding plugin and using this method to git tag, it is failing due to a character that requires url encoding in the password.
To push to a git repo, it's required to URL encode (for example @'s in the username and password for "http://username:password@<gitrepo>" are not read properly)
When i import java.net.URLEncoder and URLEncoder.encode(password) in the groovy file i get this:
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod java.net.URLEncoder encode java.lang.String
So, the question is, is there a way to URL encode the password that is idiomatic for Jenkinsfiles?
I would like to avoid something dirty like piping the parameter into bash and sed-ing the password to replace special characters if there is a cleaner and more readable solution.