Skip to content

Commit 41a6fa3

Browse files
committed
try/catch on git push
1 parent 494e1fa commit 41a6fa3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ async function run(): Promise<void> {
7676
'-m',
7777
`Capturing event ${eventName} (id: ${id})`,
7878
])
79-
const code = await exec('git', ['push'])
80-
if (code === 0) {
81-
// success! We're finished.
79+
try {
80+
await exec('git', ['push'])
81+
// if the push succeeded, we're finished
8282
core.info('Success!')
8383
break
84-
} else {
84+
} catch (error) {
8585
core.info('Retrying because of conflicts...')
8686
await exec('git', ['reset', '--hard', 'HEAD'])
8787
await exec('git', ['pull'])

0 commit comments

Comments
 (0)