From ae0be2aa4fbcfb7145ae466f761e962725b6eebe Mon Sep 17 00:00:00 2001
From: ThinhHV <thinh@thinhhv.com>
Date: Sun, 17 Mar 2024 02:54:17 +0700
Subject: [PATCH] Fix not working when no theadKey

Signed-off-by: ThinhHV <thinh@thinhhv.com>
---
 README.md    | 2 +-
 package.json | 2 +-
 src/chat.ts  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 06e9345..0a53866 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ This repository is generated by [typescript-action](https://github.com/actions/t
 
 ```yaml
 - name: Google Chat Notification
-  uses: nakamuraos/google-chat-notifications@v3.1.0
+  uses: nakamuraos/google-chat-notifications@v3.2.0
   with:
     title: Build
     subtitle: ${{ github.event.head_commit.message }}
diff --git a/package.json b/package.json
index 4bd3d30..c0b695e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "google-chat-notifications",
-  "version": "3.1.0",
+  "version": "3.2.0",
   "private": true,
   "description": "Google Chat Notifications for GitHub Actions",
   "main": "dist/index.js",
diff --git a/src/chat.ts b/src/chat.ts
index b1b0bcc..b4c1472 100644
--- a/src/chat.ts
+++ b/src/chat.ts
@@ -124,7 +124,7 @@ export async function notify({
   }
 
   const response = await axios.default.post(
-    webhookUrl + '&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD',
+    webhookUrl + body.thread ? '&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD' : '',
     body,
   )
   if (response.status !== 200) {