File tree Expand file tree Collapse file tree 2 files changed +32
-48
lines changed Expand file tree Collapse file tree 2 files changed +32
-48
lines changed Original file line number Diff line number Diff line change @@ -754927,33 +754927,25 @@ const cleanUp = () => {
754927
754927
}
754928
754928
};
754929
754929
754930
- try {
754931
- if (action === 'push') {
754932
- pushMain().then(() => {
754933
- cleanUp();
754934
- }).catch((error) => {
754935
- core.setFailed(`Action failed with error: ${error.message}`);
754936
- cleanUp();
754937
- process.exit(1);
754938
- });
754939
- } else if (action === 'pull') {
754940
- pullMain().then(() => {
754941
- cleanUp();
754942
- }).catch((error) => {
754943
- core.setFailed(`Action failed with error: ${error.message}`);
754944
- cleanUp();
754930
+ const runAction = async () => {
754931
+ try {
754932
+ if (action === 'push') {
754933
+ await pushMain();
754934
+ } else if (action === 'pull') {
754935
+ await pullMain();
754936
+ } else {
754937
+ core.setFailed(`Unknown action: ${action}`);
754945
754938
process.exit(1);
754946
- });
754947
- } else {
754948
- core.setFailed(`Unknown action: ${action}`);
754949
- cleanUp();
754939
+ }
754940
+ } catch (error) {
754941
+ core.setFailed(`Action failed with error: ${error.message}`);
754950
754942
process.exit(1);
754943
+ } finally {
754944
+ cleanUp();
754951
754945
}
754952
- } catch (error) {
754953
- core.setFailed(`Action failed with error: ${error.message}`);
754954
- cleanUp();
754955
- process.exit(1);
754956
- }
754946
+ };
754947
+
754948
+ runAction();
754957
754949
754958
754950
module.exports = __webpack_exports__;
754959
754951
/******/ })()
Original file line number Diff line number Diff line change @@ -64,30 +64,22 @@ const cleanUp = () => {
64
64
}
65
65
} ;
66
66
67
- try {
68
- if ( action === 'push' ) {
69
- pushMain ( ) . then ( ( ) => {
70
- cleanUp ( ) ;
71
- } ) . catch ( ( error ) => {
72
- core . setFailed ( `Action failed with error: ${ error . message } ` ) ;
73
- cleanUp ( ) ;
74
- process . exit ( 1 ) ;
75
- } ) ;
76
- } else if ( action === 'pull' ) {
77
- pullMain ( ) . then ( ( ) => {
78
- cleanUp ( ) ;
79
- } ) . catch ( ( error ) => {
80
- core . setFailed ( `Action failed with error: ${ error . message } ` ) ;
81
- cleanUp ( ) ;
67
+ const runAction = async ( ) => {
68
+ try {
69
+ if ( action === 'push' ) {
70
+ await pushMain ( ) ;
71
+ } else if ( action === 'pull' ) {
72
+ await pullMain ( ) ;
73
+ } else {
74
+ core . setFailed ( `Unknown action: ${ action } ` ) ;
82
75
process . exit ( 1 ) ;
83
- } ) ;
84
- } else {
85
- core . setFailed ( `Unknown action: ${ action } ` ) ;
86
- cleanUp ( ) ;
76
+ }
77
+ } catch ( error ) {
78
+ core . setFailed ( `Action failed with error: ${ error . message } ` ) ;
87
79
process . exit ( 1 ) ;
80
+ } finally {
81
+ cleanUp ( ) ;
88
82
}
89
- } catch ( error ) {
90
- core . setFailed ( `Action failed with error: ${ error . message } ` ) ;
91
- cleanUp ( ) ;
92
- process . exit ( 1 ) ;
93
- }
83
+ } ;
84
+
85
+ runAction ( ) ;
You can’t perform that action at this time.
0 commit comments