@@ -74810,6 +74810,35 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
74810
74810
74811
74811
/* global $ */
74812
74812
$.verbose = false
74813
+ const retryLimit = 10
74814
+
74815
+ const getResult = async (context, token, branch, repo, files, message, tag, count) => {
74816
+ if (!count) count = 0
74817
+ try {
74818
+ const result = await (0,_commit_mjs__WEBPACK_IMPORTED_MODULE_2__/* .commit */ .t)(
74819
+ {
74820
+ token,
74821
+ branch,
74822
+ owner: repo[0],
74823
+ repo: repo[1],
74824
+ },
74825
+ files,
74826
+ message,
74827
+ tag
74828
+ )
74829
+ echo`${JSON.stringify({ result, context, branch, repo, message, tag }, undefined, 2)}`
74830
+ return result
74831
+ } catch (error) {
74832
+ if (error.message === 'Update is not a fast forward' && count <= retryLimit ) {
74833
+ count++
74834
+ return await getResult(context, token, branch, repo, files, message, tag, count)
74835
+ } else if (error.message === 'Update is not a fast forward') {
74836
+ throw new Error('Update is not a fast forward, retry limit reached.')
74837
+ } else {
74838
+ throw error
74839
+ }
74840
+ }
74841
+ }
74813
74842
74814
74843
try {
74815
74844
const filesInput = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('files')
@@ -74820,18 +74849,7 @@ try {
74820
74849
const branch = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('ref') || context.github.ref_name
74821
74850
const tag = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('tag') || false
74822
74851
const files = await (0,_get_files_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getFiles */ .b)(filesInput)
74823
- const result = await (0,_commit_mjs__WEBPACK_IMPORTED_MODULE_2__/* .commit */ .t)(
74824
- {
74825
- token,
74826
- branch,
74827
- owner: repo[0],
74828
- repo: repo[1],
74829
- },
74830
- files,
74831
- message,
74832
- tag
74833
- )
74834
- echo`${JSON.stringify({ result, context, branch, repo, message, tag }, undefined, 2)}`
74852
+ const result = await getResult(context, token, branch, repo, files, message, tag)
74835
74853
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput('sha', result.object?.sha)
74836
74854
} catch (error) {
74837
74855
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed(error.message)
0 commit comments