Skip to content

Commit 6eb043a

Browse files
ci: allow commits on top of beta PRs (anomalyco#11924)
1 parent e96f638 commit 6eb043a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/nix-hashes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ permissions:
66
on:
77
workflow_dispatch:
88
push:
9-
branches: [dev]
9+
branches: [dev, beta]
1010
paths:
1111
- "bun.lock"
1212
- "package.json"

script/beta.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,15 @@ async function main() {
128128
await $`git fetch origin beta`
129129

130130
const localTree = await $`git rev-parse beta^{tree}`.text()
131-
const remoteTree = await $`git rev-parse origin/beta^{tree}`.text()
132-
133-
if (localTree.trim() === remoteTree.trim()) {
134-
console.log("Beta branch has identical contents, no push needed")
131+
const remoteTrees = (await $`git log origin/dev..origin/beta --format=%T`.text()).split("\n")
132+
133+
const matchIdx = remoteTrees.indexOf(localTree.trim())
134+
if (matchIdx !== -1) {
135+
if (matchIdx !== 0) {
136+
console.log(`Beta branch contains this sync, but additional commits exist after it. Leaving beta branch as is.`)
137+
} else {
138+
console.log("Beta branch has identical contents, no push needed")
139+
}
135140
return
136141
}
137142

0 commit comments

Comments
 (0)