Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Detect if pipeline is launch manually or not
script
{
//before using this command line you should approve execution on https://jenkins_url/scriptApproval/
launchManually = currentBuild.rawBuild.getCause(hudson.model.Cause$UserIdCause) != null
if(launchManually)
{
echo "Manually launch"
}
else
{
echo "Automatic launch"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment