From 583389a0b527dd9215fbc311ebe9db5e9de33a53 Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Mon, 29 Sep 2025 21:54:53 +0900 Subject: [PATCH 1/6] =?UTF-8?q?onOpen=20=E9=96=A2=E6=95=B0=E5=86=85?= =?UTF-8?q?=E3=81=A7=E5=AE=9A=E7=BE=A9=E3=81=95=E3=82=8C=E3=82=8B=E3=83=A1?= =?UTF-8?q?=E3=83=8B=E3=83=A5=E3=83=BC=E3=81=AE=E5=90=8D=E5=89=8D=E3=81=A8?= =?UTF-8?q?=E5=AE=9F=E8=A1=8C=E3=81=95=E3=82=8C=E3=82=8B=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.gs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.gs b/main.gs index d28f47f..e2a155f 100644 --- a/main.gs +++ b/main.gs @@ -1,8 +1,8 @@ -// onOpen関数は変更不要です。 function onOpen() { var ui = SpreadsheetApp.getUi(); var menu = ui.createMenu('出版'); - menu.addItem('Google Chat に送信', 'showChangesDialog'); // 関数名を変更 + menu.addItem('変更内容を登録', 'commitRevision') + menu.addItem('Google Chat に送信', 'mergeMain'); menu.addToUi(); } From caf8d37e8e4b7bc17176f1cf3a925a66ee9b9173 Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Mon, 29 Sep 2025 22:18:24 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=82=92=20".changelog"=20=E3=82=B7=E3=83=BC=E3=83=88=E3=81=AB?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E3=81=95=E3=81=9B=E3=82=8B=E3=83=97=E3=83=AD?= =?UTF-8?q?=E3=82=B0=E3=83=A9=E3=83=A0=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changesInput.html | 14 +++++++------- main.gs | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/changesInput.html b/changesInput.html index a63eaec..92d19a1 100644 --- a/changesInput.html +++ b/changesInput.html @@ -51,16 +51,16 @@ - レイアウトの調整 - バグの修正">
diff --git a/main.gs b/main.gs index e2a155f..6369768 100644 --- a/main.gs +++ b/main.gs @@ -1,13 +1,13 @@ function onOpen() { var ui = SpreadsheetApp.getUi(); var menu = ui.createMenu('出版'); - menu.addItem('変更内容を登録', 'commitRevision') + menu.addItem('変更内容を登録', 'showCommitRevision') menu.addItem('Google Chat に送信', 'mergeMain'); menu.addToUi(); } // ユーザーに変更内容を尋ねるダイアログを表示する関数 -function showChangesDialog() { +function showCommitRevision() { const html = HtmlService.createTemplateFromFile('changesInput') .evaluate() .setTitle('変更内容を記述') @@ -15,6 +15,20 @@ function showChangesDialog() { SpreadsheetApp.getUi().showSidebar(html); } +// 変更内容の保存 +function saveCommitRevision(changes) { + const activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet(); + const changelogSheet = activeSpreadsheet.getSheetByName('.changelog'); + const editorEmail = Session.getActiveUser().getEmail(); + + var changelogSheet_array = [] + for (let i = 0; i < changes.length; i++) { + changelogSheet_array.push([editorEmail, changes[i]]) + } + + changelogSheet.getRange(changelogSheet.getLastRow() + 1, 1, changes.length, 2).setValues(changelogSheet_array) +} + // メニュー: Google Chat に送信 (変更内容の処理を含む) function processAndSend(changes) { // ユーザーがキャンセルした場合や何も入力しなかった場合の処理 From c6cc6fb1f21f14e3409b13f6611aadfd67e0d7c0 Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Mon, 29 Sep 2025 22:22:10 +0900 Subject: [PATCH 3/6] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=81=AE=E4=BF=9D=E5=AD=98=E6=99=82=E3=81=AB=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=A0=E3=82=B9=E3=82=BF=E3=83=B3=E3=83=97=E3=82=82=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.gs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.gs b/main.gs index 6369768..47ac0f7 100644 --- a/main.gs +++ b/main.gs @@ -21,12 +21,14 @@ function saveCommitRevision(changes) { const changelogSheet = activeSpreadsheet.getSheetByName('.changelog'); const editorEmail = Session.getActiveUser().getEmail(); + const timeStamp = new Date() + var changelogSheet_array = [] for (let i = 0; i < changes.length; i++) { - changelogSheet_array.push([editorEmail, changes[i]]) + changelogSheet_array.push([timeStamp, editorEmail, changes[i]]) } - changelogSheet.getRange(changelogSheet.getLastRow() + 1, 1, changes.length, 2).setValues(changelogSheet_array) + changelogSheet.getRange(changelogSheet.getLastRow() + 1, 1, changelogSheet_array.length, changelogSheet_array[0].length).setValues(changelogSheet_array) } // メニュー: Google Chat に送信 (変更内容の処理を含む) From da4a98aff2a344ca94b2eb86a9077b693b8a9a09 Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Mon, 29 Sep 2025 22:24:14 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=82=92=E4=BF=9D=E5=AD=98=E6=99=82=E3=81=AB=E3=83=9E=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E7=8A=B6=E6=B3=81=E3=82=92=E4=BF=9D=E5=AD=98=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=83=97=E3=83=AD=E3=82=B0=E3=83=A9=E3=83=A0=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.gs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.gs b/main.gs index 47ac0f7..49dead8 100644 --- a/main.gs +++ b/main.gs @@ -25,7 +25,7 @@ function saveCommitRevision(changes) { var changelogSheet_array = [] for (let i = 0; i < changes.length; i++) { - changelogSheet_array.push([timeStamp, editorEmail, changes[i]]) + changelogSheet_array.push([timeStamp, editorEmail, changes[i], false]) } changelogSheet.getRange(changelogSheet.getLastRow() + 1, 1, changelogSheet_array.length, changelogSheet_array[0].length).setValues(changelogSheet_array) From 78227582701eb6d6a582ace34464ae6e894b3b79 Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Wed, 15 Oct 2025 08:21:32 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=82=92=E3=82=B9=E3=83=97=E3=83=AC=E3=83=83=E3=83=89=E3=82=B7?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=8B=E3=82=89=E5=8F=96=E5=BE=97=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=83=97=E3=83=AD=E3=82=B0=E3=83=A9=E3=83=A0=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.gs | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/main.gs b/main.gs index 49dead8..f1157af 100644 --- a/main.gs +++ b/main.gs @@ -31,14 +31,31 @@ function saveCommitRevision(changes) { changelogSheet.getRange(changelogSheet.getLastRow() + 1, 1, changelogSheet_array.length, changelogSheet_array[0].length).setValues(changelogSheet_array) } -// メニュー: Google Chat に送信 (変更内容の処理を含む) -function processAndSend(changes) { - // ユーザーがキャンセルした場合や何も入力しなかった場合の処理 - if (!changes) { - SpreadsheetApp.getUi().alert('出版がキャンセルされました。'); - return; +// 変更内容の取得 +function getChangelogs(spreadsheetId, sheetName) { + const changelogSheet = SpreadsheetApp.openById(spreadsheetId).getSheetByName(sheetName); + const allChangelogs = changelogSheet.getRange(1, 1, changelogSheet.getLastRow(), changelogSheet.getLastColumn()).getValues(); + + var changelog = [] + var isMergedFlags = [] + var sellIndex = 1 + for (let i = 0; i < allChangelogs.length - 1; i++) { + if (allChangelogs[sellIndex][3] == false) { + changelog.push(allChangelogs[sellIndex]); + isMergedFlags.push([true]) + } else { + isMergedFlags.push([true]) + } + sellIndex += 1 } - + + changelogSheet.getRange(2, 4, changelogSheet.getLastRow()-1).setValues(isMergedFlags) + + return changelog +} + +// メニュー: Google Chat に送信 (変更内容の処理を含む) +function mergeMain() { const scriptProperties = PropertiesService.getScriptProperties(); const PARENT_FOLDER_ID = scriptProperties.getProperty("PARENT_FOLDER_ID"); const GOOGLE_CHAT_WEBHOOK_URL = scriptProperties.getProperty("GOOGLE_CHAT_WEBHOOK_URL"); @@ -51,6 +68,13 @@ function processAndSend(changes) { Logger.log('シート名: ' + sheetName); Logger.log('スプレッドシートID: ' + spreadsheetId); + // 変更内容の取得 + const changelogs = getChangelogs(ss.getId(), '.changelog'); + var changes = [] + for (let i = 0; i < changelogs.length; i++) { + changes.push(changelogs[i][2]) + } + // ブランチファイル(キャッシュファイル)を削除 deleteSheetsStartingWithBracket(spreadsheetId); From c55c8e5d6fd8a2ce86c0ded8f3dd82f7b8cecfef Mon Sep 17 00:00:00 2001 From: "Pasubu.book" <163115290+pasububook@users.noreply.github.com> Date: Sun, 26 Oct 2025 16:22:46 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E8=A1=A8=E8=A8=98=E3=81=AE=E8=87=AA=E5=8B=95=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=A9=9F=E8=83=BD=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.gs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.gs b/main.gs index f1157af..99336fc 100644 --- a/main.gs +++ b/main.gs @@ -75,6 +75,12 @@ function mergeMain() { changes.push(changelogs[i][2]) } + // バージョン表記の更新 + // '.config'!B2: バージョン情報が記載されたせる + const configSheet = ss.getSheetByName(".config") + const nowDocVer = configSheet.getRange("B2").getValue(); + const newDocVer = configSheet.getRange("B2").setValue(Number(nowDocVer) + 1); + // ブランチファイル(キャッシュファイル)を削除 deleteSheetsStartingWithBracket(spreadsheetId); @@ -102,4 +108,4 @@ function mergeMain() { sendGooglechat(message_content, GOOGLE_CHAT_WEBHOOK_URL); SpreadsheetApp.getUi().alert('出版が完了しました。'); -} +} \ No newline at end of file