Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

fix(google-drive): keep files starred when an agent renames them (#16735)

Kishan Parmarf9809201e50a
diff --git a/bun.lock b/bun.lock
index 89282463840..d0f3852a634 100644
--- a/bun.lock
+++ b/bun.lock
@@ -3947,7 +3947,7 @@
},
"packages/pieces/community/google-drive": {
"name": "@activepieces/piece-google-drive",
- "version": "0.12.2",
+ "version": "0.13.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
diff --git a/packages/pieces/community/google-drive/package.json b/packages/pieces/community/google-drive/package.json
index d418b2f0320..34b9323e9fe 100644
--- a/packages/pieces/community/google-drive/package.json
+++ b/packages/pieces/community/google-drive/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-google-drive",
- "version": "0.12.2",
+ "version": "0.13.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"dependencies": {
diff --git a/packages/pieces/community/google-drive/src/i18n/translation.json b/packages/pieces/community/google-drive/src/i18n/translation.json
index 0f0f5c701bc..dbf8681ab4d 100644
--- a/packages/pieces/community/google-drive/src/i18n/translation.json
+++ b/packages/pieces/community/google-drive/src/i18n/translation.json
@@ -251,7 +251,7 @@
"The ID of the file or folder to update. Resolve it via `drive_search_files` or `drive_get_file`.": "The ID of the file or folder to update. Resolve it via `drive_search_files` or `drive_get_file`.",
"A new name for the file or folder. Leave empty to keep the current name.": "A new name for the file or folder. Leave empty to keep the current name.",
"A new description for the file or folder. Leave empty to keep the current description.": "A new description for the file or folder. Leave empty to keep the current description.",
- "Whether to mark the file or folder as starred.": "Whether to mark the file or folder as starred.",
+ "Whether to mark the file or folder as starred. Leave empty or pick Leave unchanged to keep the current setting.": "Whether to mark the file or folder as starred. Leave empty or pick Leave unchanged to keep the current setting.",
"The ID of the document to export. Resolve it via `drive_search_files`.": "The ID of the document to export. Resolve it via `drive_search_files`.",
"The ID of the folder where the file will be exported. Resolve it via `drive_search_files`.": "The ID of the folder where the file will be exported. Resolve it via `drive_search_files`.",
"The name of the new file (do not include the extension)": "The name of the new file (do not include the extension)",
@@ -339,6 +339,9 @@
"All": "All",
"Files": "Files",
"Folders": "Folders",
+ "Yes": "Yes",
+ "No": "No",
+ "Leave unchanged": "Leave unchanged",
"Organizer": "Organizer",
"File Organizer": "File Organizer",
"Writer": "Writer",
@@ -351,6 +354,17 @@
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
+ "New file": "New file",
+ "Save to": "Save to",
+ "Search for": "Search for",
+ "Limit results": "Limit results",
+ "What to share": "What to share",
+ "Who gets access": "Who gets access",
+ "Folder to export": "Folder to export",
+ "Convert Google files": "Convert Google files",
+ "Output": "Output",
+ "Request": "Request",
+ "Data to send": "Data to send",
"New File": "New File",
"New Folder": "New Folder",
"New or Updated File": "New or Updated File",
diff --git a/packages/pieces/community/google-drive/src/lib/action/drive-update-file-metadata.ts b/packages/pieces/community/google-drive/src/lib/action/drive-update-file-metadata.ts
index 8bb4a7dbfa8..19d056cb96b 100644
--- a/packages/pieces/community/google-drive/src/lib/action/drive-update-file-metadata.ts
+++ b/packages/pieces/community/google-drive/src/lib/action/drive-update-file-metadata.ts
@@ -34,14 +34,24 @@ export const driveUpdateFileMetadata = createAction({
description: 'A new description for the file or folder. Leave empty to keep the current description.',
required: false,
}),
- starred: Property.Checkbox({
+ starred: Property.StaticDropdown<string, false>({
displayName: 'Starred',
- description: 'Whether to mark the file or folder as starred.',
+ description:
+ 'Whether to mark the file or folder as starred. Leave empty or pick Leave unchanged to keep the current setting.',
required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'yes' },
+ { label: 'No', value: 'no' },
+ { label: 'Leave unchanged', value: 'unchanged' },
+ ],
+ },
}),
},
async run(context) {
- const { file_id, name, description, starred } = context.propsValue;
+ const { file_id, name, description } = context.propsValue;
+ const starred = starredValue(context.propsValue.starred);
const requestBody: { name?: string; description?: string; starred?: boolean } =
{};
@@ -51,7 +61,7 @@ export const driveUpdateFileMetadata = createAction({
if (description !== undefined && description !== null) {
requestBody.description = description;
}
- if (starred !== undefined && starred !== null) {
+ if (starred !== undefined) {
requestBody.starred = starred;
}
@@ -81,3 +91,10 @@ export const driveUpdateFileMetadata = createAction({
}
},
});
+
+function starredValue(value: unknown): boolean | undefined {
+ const normalized = typeof value === 'string' ? value.trim().toLowerCase() : value;
+ if (normalized === true || normalized === 'yes' || normalized === 'true') return true;
+ if (normalized === false || normalized === 'no' || normalized === 'false') return false;
+ return undefined;
+}