You can encode the script as Base64 (URL-safe without padding) and then, simply append it to the url via &code=<code>
. This is best used for shorter scripts.
For larger scripts you can also use a compressed (deflate) Base64 encoded version with via &codez=<code>
. This is also used by the groovy console.
You can save your code on https://gist.github.com and then share by appending the gistId in the url&gist=<gistid>
.
Important: that file needs to have the .groovy
extension, otherwise it won't be picked up.
You can share a file from a github repository via its canonical url via this parameter &github=<canonical-path-to-file>
. You can get the canonical-path-to-file
by going to the file on the github frontend, then press y
now your url should include the commit hash instead of the branch name in the url, then omit the https://github.com/
and copy the rest.