Jenkins Workflow Checkout Accessing BRANCH_NAME and GIT_COMMIT

前端 未结 3 1664
余生分开走
余生分开走 2020-12-08 16:02

I cannot seem to extract $GIT_COMMIT and $BRANCH_NAME from a Jenkins Workflow Checkout step.

I would like to be able to send this information through to my Gradle sc

3条回答
  •  轮回少年
    2020-12-08 16:08

    If you want to access the BRANCH_NAME from Jenkins environment variable as a shell script, use the below snippet.

    sh 'echo Branch Name: $BRANCH_NAME'

    The response should be as below:

    Branch Name: the_checkedout_branch

提交回复
热议问题