Skip to content

Commit

Permalink
ignore error when nothing is mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
adityamaru committed Dec 15, 2024
1 parent 23eae44 commit 53000f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,11 @@ actionsToolkit.run(
core.info('Unmounted device');
}
} catch (error) {
// Only log warning if error is not from grep finding no mounts
if (!error.message.includes('exit code 1')) {
// grep returns exit code 1 when no matches are found.
if (error.code === 1) {
core.debug('No dangling mounts found to clean up');
} else {
// Only warn for actual errors, not for the expected case where grep finds nothing.
core.warning(`Error during cleanup: ${error.message}`);
}
}
Expand Down

0 comments on commit 53000f0

Please sign in to comment.