mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-18 23:52:42 +00:00
ci: skip force push when beta branch is unchanged
This commit is contained in:
parent
d3d783e23d
commit
3ab41d548f
1 changed files with 12 additions and 1 deletions
|
|
@ -124,7 +124,18 @@ async function main() {
|
|||
throw new Error(`${failed.length} PR(s) failed to merge`)
|
||||
}
|
||||
|
||||
console.log("\nForce pushing beta branch...")
|
||||
console.log("\nChecking if beta branch has changes...")
|
||||
await $`git fetch origin beta`
|
||||
|
||||
const localTree = await $`git rev-parse beta^{tree}`.text()
|
||||
const remoteTree = await $`git rev-parse origin/beta^{tree}`.text()
|
||||
|
||||
if (localTree.trim() === remoteTree.trim()) {
|
||||
console.log("Beta branch has identical contents, no push needed")
|
||||
return
|
||||
}
|
||||
|
||||
console.log("Force pushing beta branch...")
|
||||
await $`git push origin beta --force --no-verify`
|
||||
|
||||
console.log("Successfully synced beta branch")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue