From 174e263f9cc69d11f511525030e02565c2d0b783 Mon Sep 17 00:00:00 2001 From: vn7n24fzkq Date: Sat, 5 Sep 2020 16:24:00 +0800 Subject: [PATCH] v0.1.3-patch --- dist/index.js | 14 +++++++++++++- package.json | 2 +- src/app.js | 14 +++++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index acb5761ba..bc85f7472 100755 --- a/dist/index.js +++ b/dist/index.js @@ -17963,7 +17963,19 @@ const main = async () => { } if (isInGithubAction) { core.info(`Commit file...`); - await commitFile(); + let retry = 0; + let maxRetry = 3; + while (retry < maxRetry) { + retry += 1; + try { + await commitFile(); + } catch (error) { + if (retry == maxRetry) { + throw error; + } + core.warn(`Commit failed. Retry...`); + } + } } } catch (error) { core.error(error); diff --git a/package.json b/package.json index da120742e..e4789aa40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-profile-summary-cards", - "version": "0.1.2", + "version": "0.1.3", "description": "Generate github profile summary cards", "main": "src/app.js", "scripts": { diff --git a/src/app.js b/src/app.js index cf69e679d..f5f914f3c 100644 --- a/src/app.js +++ b/src/app.js @@ -253,7 +253,19 @@ const main = async () => { } if (isInGithubAction) { core.info(`Commit file...`); - await commitFile(); + let retry = 0; + let maxRetry = 3; + while (retry < maxRetry) { + retry += 1; + try { + await commitFile(); + } catch (error) { + if (retry == maxRetry) { + throw error; + } + core.warn(`Commit failed. Retry...`); + } + } } } catch (error) { core.error(error);