浏览代码

updating error handling

Vallie Joseph 2 年之前
父节点
当前提交
24ec60a7c8
共有 2 个文件被更改,包括 14 次插入2 次删除
  1. 7 1
      dist/index.js
  2. 7 1
      src/git-auth-helper.ts

+ 7 - 1
dist/index.js

@@ -7204,7 +7204,13 @@ class GitAuthHelper {
             if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
                 core.debug(`Unsetting HOME override`);
                 this.git.removeEnvironmentVariable('HOME');
-                yield io.rmRF(this.temporaryHomePath);
+                yield io
+                    .rmRF(this.temporaryHomePath)
+                    // eslint-disable-next-line github/no-then
+                    .catch(err => {
+                    // eslint-disable-next-line i18n-text/no-en
+                    core.warning(`Failed to remove temporary home directory: ${err}`);
+                });
             }
         });
     }

+ 7 - 1
src/git-auth-helper.ts

@@ -197,7 +197,13 @@ class GitAuthHelper {
     if (this.temporaryHomePath?.length > 0) {
       core.debug(`Unsetting HOME override`)
       this.git.removeEnvironmentVariable('HOME')
-      await io.rmRF(this.temporaryHomePath)
+      await io
+        .rmRF(this.temporaryHomePath)
+        // eslint-disable-next-line github/no-then
+        .catch(err => {
+          // eslint-disable-next-line i18n-text/no-en
+          core.warning(`Failed to remove temporary home directory: ${err}`)
+        })
     }
   }