From 3ff10bbd0bf5e87bc82b46f784a65f437b1cd3af Mon Sep 17 00:00:00 2001 From: leonhartX Date: Fri, 10 Sep 2021 10:23:05 +0900 Subject: [PATCH 1/2] check bind repo with scm --- src/gas-hub.js | 6 +++++- src/scm/bitbucket.js | 3 ++- src/scm/github.js | 3 ++- src/scm/gitlab.js | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gas-hub.js b/src/gas-hub.js index ea3892f..70ad1e1 100644 --- a/src/gas-hub.js +++ b/src/gas-hub.js @@ -100,6 +100,9 @@ function initContext() { context.gapiToken = item.gapiToken; scm = createSCM(item); context.bindRepo = item.bindRepo || {}; + if (context.bindRepo[getId()].scm !== scm.name) { + delete context.bindRepo[getId()] + } context.bindBranch = item.bindBranch || {}; context.bindType = item.bindType || {}; context.bindPattern = item.bindPattern || {}; @@ -298,7 +301,8 @@ function initPageEvent() { const fullName = target.attr('data'); content = { fullName: fullName, - gist: fullName === 'gist' + gist: fullName === 'gist', + scm: scm.name } label = fullName; break; diff --git a/src/scm/bitbucket.js b/src/scm/bitbucket.js index 087acb9..bf80d47 100644 --- a/src/scm/bitbucket.js +++ b/src/scm/bitbucket.js @@ -225,7 +225,8 @@ class Bitbucket { }) .then(response => { const repo = { - fullName: response.full_name + fullName: response.full_name, + scm: this.name }; Object.assign(context.bindRepo, { [getId()]: repo diff --git a/src/scm/github.js b/src/scm/github.js index eb007be..1cc408f 100644 --- a/src/scm/github.js +++ b/src/scm/github.js @@ -369,7 +369,8 @@ class Github { }) .then(response => { const repo = { - fullName: response.full_name + fullName: response.full_name, + scm: this.name }; Object.assign(context.bindRepo, { [getId()]: repo diff --git a/src/scm/gitlab.js b/src/scm/gitlab.js index 1a74476..2b21abc 100644 --- a/src/scm/gitlab.js +++ b/src/scm/gitlab.js @@ -220,7 +220,8 @@ class Gitlab { .then(response => { const repo = { fullName: response.path_with_namespace, - id: response.id + id: response.id, + scm: this.name }; Object.assign(context.bindRepo, { [getId()]: repo From 5457b80846a2c372fd32934efcbb2da55b89a485 Mon Sep 17 00:00:00 2001 From: leonhartX Date: Fri, 10 Sep 2021 10:27:40 +0900 Subject: [PATCH 2/2] bump version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 64d58b5..5c55eee 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "version": "5.0.5", + "version": "5.0.6", "manifest_version": 2, "default_locale": "en", "name": "__MSG_appName__",