Determine Git revision in Jenkins without checkout
Using Jenkin multibranch declarative pipeline with Git. In the stage, the necessary environment variable exists: GIT_COMMIT
. However, I don’t need a checkout in this stage for the steps, I just need GIT_COMMIT
to construct a blob path to add some lock files in Azure. I would like to avoid the checkout.
Cloning from GitHub using Git Plugin with Declarative Jenkins Pipeline
I’ve been having problems cloning from GitHub in my declarative pipeline. I’ve tried this: