Hi ,
I want t create github branch from workflow post function .
I am able to run it through server but I am getting below error while running in Script runner .
def url = '{"ref":"refs/heads/Scriptrunner_branch124","sha":"5z12347f551369e1ff3e176c55a8640ee9d7c16b"}'
def command = 'curl -X POST -H "Authorization: token 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" https://api.github.com/repos/login_name/repo_name/git/refs -d "$url"'
def proc = command.execute()
proc.waitFor()
println "Process exit code: ${proc.exitValue()}"
println "Std Err: ${proc.err.text}"
println "Std Out: ${proc.in.text}"
I am getting below error
org.codehaus.groovy.runtime.InvokerInvocationException: java.io.IOException: Cannot run program "curl": error=2, No such file or directory at ConsoleScriptExecution1_groovyProxy.run(Unknown Source) Caused by: java.io.IOException: Cannot run program "curl": error=2, No such file or directory at Script1.run(Script1.groovy:7)
Could you please help me to resolve this ?