diff --git a/src/clean-pip.ts b/src/clean-pip.ts index 233c8207..fa0d6770 100644 --- a/src/clean-pip.ts +++ b/src/clean-pip.ts @@ -9,7 +9,7 @@ export async function cleanPipPackages() { // Use a shell so we can pipe the output of pip freeze into xargs await exec('bash', [ '-c', - 'python -m pip freeze | xargs python -m pip uninstall' + 'test $(python3 -m pip freeze | wc -l) -gt 0 && python3 -m pip freeze | xargs python3 -m pip uninstall -y' ]); core.info('Successfully cleaned up pip packages'); } catch (error) {