Skip to content

Commit

Permalink
build(ci): update release script remove stdin input (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusrbrown authored Mar 3, 2024
1 parent 2f17e9d commit 0ec0fdf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-panthers-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bfra.me/.github": patch
---

Build: Update `release` script to remove `stdin` input
16 changes: 10 additions & 6 deletions scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ async function main() {
});
if (branchExitCode !== 0) {
// Create a new floating major branch
await exec('gh', ['api', `repos/${process.env.GH_REPO}/git/refs`, '--input', '-'], {
input: Buffer.from(JSON.stringify({ref, sha})),
});
await exec('gh', ['api', `repos/${process.env.GH_REPO}/git/refs`, '-f', `ref=${ref}`, '-f', `sha=${sha}`]);
} else {
// Update existing branch
await exec('gh', ['api', `-XPATCH`, `repos/${process.env.GH_REPO}/git/${ref}`, '--input', '-'], {
input: Buffer.from(JSON.stringify({sha})),
});
await exec('gh', [
'api',
`repos/${process.env.GH_REPO}/git/${ref}`,
'-XPATCH',
'-f',
`sha=${sha}`,
'-F',
'force=true',
]);
}
}

Expand Down

0 comments on commit 0ec0fdf

Please sign in to comment.