From fa7f16360e7d5a762a8d9c311480ec1e0246ceb6 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 21 Sep 2021 20:41:01 +0200 Subject: [PATCH] Governance: Signing Accounts implementation - Fix --- Platform/Client/githubServer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Platform/Client/githubServer.js b/Platform/Client/githubServer.js index 47823b677..b40fa153d 100644 --- a/Platform/Client/githubServer.js +++ b/Platform/Client/githubServer.js @@ -591,16 +591,17 @@ exports.newGithubServer = function newGithubServer() { for (let i = 0; i < userProfile.signingAccounts.length; i++) { let signingAccount = userProfile.signingAccounts[i] let config = JSON.parse(signingAccount.config) + let messageSigned = config.signature.message - if (config.signature.message !== githubUsername) { - console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #8 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Signing Account ' + signingAccount.name + ' has not signed the current Github User Account, but something else. -> config.signature.message = ' + config.signature.message + '-> githubUsername = ' + githubUsername) + if (messageSigned !== githubUsername) { + console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #8 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Signing Account ' + signingAccount.name + ' has not signed the current Github User Account, but something else. -> messageSigned = ' + messageSigned + '-> githubUsername = ' + githubUsername) await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, repo: repo, issue_number: pullRequest.number, - body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because the Signing Account ' + signingAccount.name + ' has not signed the current Github User Account, but something else. \n\nconfig.signature.message = ' + config.signature.message + '" \n\n githubUsername = ' + githubUsername + '"' + body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because the Signing Account ' + signingAccount.name + ' has not signed the current Github User Account, but something else. \n\n messageSigned = ' + messageSigned + '" \n\n githubUsername = ' + githubUsername + '"' }); await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)