Skip to content

Commit

Permalink
Add Bot Token for Kitalpha (#30)
Browse files Browse the repository at this point in the history
Change-Id: I79f10036ec697a3d11007b03d2aa01fbacdd84a5
Signed-off-by: Philippe DUL <philippe.dul@thalesgroup.com>
  • Loading branch information
pdulth committed Aug 9, 2021
1 parent 81d699c commit 6f3fc8d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions vars/github.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ def getProjectName() {

def pullRequestComment(message) {
def pullRequestId = getPullRequestId()
def projectName = getProjectName()
def projectName = getProjectName()
def apiURL = "https://api.github.com/repos/eclipse/${projectName}/issues/${pullRequestId}/comments"

withCredentials([string(credentialsId: '0dea5761-867c-44db-92fa-9304c81a8653', variable: 'password')]) {
sh """curl ${apiURL} -d '{"body":"${message}"}' -u 'eclipse-capella-bot:${password}' -X POST -H 'Content-Type: application/json'"""
switch(projectName){

case ~/.*kitalpha.*/:
withCredentials([string(credentialsId: '0f2238d4-cd8c-4322-b744-d9fc186a6cd0', variable: 'password')]) {
sh """curl ${apiURL} -d '{"body":"${message}"}' -u 'eclipse-kitalpha-bot:${password}' -X POST -H 'Content-Type: application/json'"""
}

default:
withCredentials([string(credentialsId: '0dea5761-867c-44db-92fa-9304c81a8653', variable: 'password')]) {
sh """curl ${apiURL} -d '{"body":"${message}"}' -u 'eclipse-capella-bot:${password}' -X POST -H 'Content-Type: application/json'"""
}
}
}

Expand Down

0 comments on commit 6f3fc8d

Please sign in to comment.