Skip to content

Instantly share code, notes, and snippets.

@scoheb
Last active March 20, 2018 01:30
Show Gist options
  • Save scoheb/21d946bc5a7c19d77e10257460a4b95b to your computer and use it in GitHub Desktop.
Save scoheb/21d946bc5a7c19d77e10257460a4b95b to your computer and use it in GitHub Desktop.
Add signature to Script Approval
import org.jenkinsci.plugins.scriptsecurity.scripts.*
ScriptApproval sa = ScriptApproval.get();
//Add a signature to the list
signature = "staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods last java.lang.Iterable"
ScriptApproval.PendingSignature s = new ScriptApproval.PendingSignature(signature, false, ApprovalContext.create())
sa.approveSignature(s.signature);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment