diff --git a/dist/post/index.js b/dist/post/index.js index 62881f2..0d62b1f 100644 --- a/dist/post/index.js +++ b/dist/post/index.js @@ -36333,7 +36333,9 @@ async function run() { core.debug(`${stickyDiskPath} is not mounted, skipping unmount`); return; } - // First try to unmount with retries + // Ensure all pending writes are flushed to disk before unmounting. + await execAsync('sync'); + // Unmount with retries. for (let attempt = 1; attempt <= 10; attempt++) { try { await execAsync(`sudo umount ${stickyDiskPath}`); diff --git a/src/post.ts b/src/post.ts index bedff4b..412d19c 100644 --- a/src/post.ts +++ b/src/post.ts @@ -80,7 +80,10 @@ async function run(): Promise { return; } - // First try to unmount with retries + // Ensure all pending writes are flushed to disk before unmounting. + await execAsync('sync'); + + // Unmount with retries. for (let attempt = 1; attempt <= 10; attempt++) { try { await execAsync(`sudo umount ${stickyDiskPath}`);