Skip to content

Commit

Permalink
sync master and dev, if there are changes
Browse files Browse the repository at this point in the history
  • Loading branch information
staffbase-robert committed Dec 2, 2021
1 parent 9aee599 commit 52f7051
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/autodev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ const autoDev = async (): Promise<void> => {
}))

if (pulls.length === 0) {
info('🎉 No Pull Requests found. Nothing to merge.')
await exec('git fetch')
await exec(`git reset --hard origin/${base}`)
if (await hasDiff('HEAD', `origin/${branch}`)) {
await exec('git push -f')
info(`🎉 No Pull Requests found. Synced "dev" and "${branch}".`)
} else {
info('🎉 No Pull Requests found. Nothing to merge.')
}
return
}

Expand Down

0 comments on commit 52f7051

Please sign in to comment.