What environment variables are set for PR builds?
BeginnerConceptMultibranch, organization folders & webhooks
Answer
BRANCH_NAME is PR-123. CHANGE_ID=123, CHANGE_URL, CHANGE_TITLE, CHANGE_AUTHOR, CHANGE_AUTHOR_EMAIL, CHANGE_TARGET (e.g. main), CHANGE_BRANCH (source branch), CHANGE_FORK (if from a fork). Use when { changeRequest() } or when { changeRequest target: 'main' } to run PR-only stages.
More on Multibranch, organization folders & webhooks
How does a multibranch pipeline work?BeginnerWhat is branch indexing and what triggers it?BeginnerWhat are the discovery traits in the GitHub branch source?IntermediateWhat does the fork PR trust setting protect against?AdvancedWhat is an organization folder?IntermediateHow does a GitHub webhook reach Jenkins and what URL do you configure?Beginner