diff --git a/Jenkinsfile b/Jenkinsfile index f097410..4e12946 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -98,11 +98,12 @@ pipeline { """ echo "PR ${prId} merged successfully into main!" - echo "GIT_COMMIT: ${env.GIT_COMMIT}" + def mergeCommitHash = sh(script: "git rev-parse HEAD", returnStdout: true).trim() + echo "Merge commit hash: ${mergeCommitHash}" sh """ curl -v -X POST -u "${GITEA_USER}:${GITEA_PASS}" \ -H "Content-Type: application/json" \ - -d '{"tag_name": "${env.NEW_VERSION}", "name": "Release ${env.NEW_VERSION}"}' \ + -d '{"tag_name": "${env.NEW_VERSION}", "name": "Release ${env.NEW_VERSION}", "target_commitish": "${mergeCommitHash}"}' \ "${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases" """ echo "New release succeeded!"