Last active
February 6, 2023 16:56
-
-
Save artem-hatchenko/c517c9771ca9b84aebc97b364cb60d0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stage("Send notification") { | |
steps { | |
script { | |
withCredentials([string(credentialsId: 'slack-app', variable: 'slack_token')]) { | |
env.SLACK_USER_ID = sh (script: """ | |
SLACK_USER_ID="\$(curl -d \"token=${slack_token}\" -d \"email=${env.AUTHOR_EMAIL}\" https://slack.com/api/users.lookupByEmail | jq -r '.user.id')" | |
echo \$SLACK_USER_ID""", returnStdout: true).trim() | |
} | |
if ("${env.PULL_REQUEST_COMMENT_COUNT}" == "0") { | |
sendBitbucketComment ("${env.REPO_FULL_NAME}", "${env.PULL_REQUEST_ID}", "${env.WELCOME_COMMENT}") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment