gh-stack 0.11.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -16
- package/package.json +1 -1
- package/src/commands/merge.ts +418 -34
- package/src/commands/submit.ts +26 -10
- package/src/commands/sync.ts +156 -4
- package/src/commands/update-prs.ts +116 -10
- package/src/index.ts +1 -1
- package/src/lib/advance.ts +185 -0
- package/src/lib/github.ts +27 -1
package/src/lib/github.ts
CHANGED
|
@@ -137,7 +137,33 @@ export async function updatePrBody(prNumber: number, body: string): Promise<bool
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
|
-
*
|
|
140
|
+
* Update a PR's title.
|
|
141
|
+
*/
|
|
142
|
+
export async function updatePrTitle(prNumber: number, title: string): Promise<boolean> {
|
|
143
|
+
try {
|
|
144
|
+
await $`gh pr edit ${prNumber} --title ${title}`.quiet();
|
|
145
|
+
return true;
|
|
146
|
+
} catch {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Repoint a PR's base branch on GitHub (`gh pr edit --base <base>`). Used when a
|
|
153
|
+
* stack advances past a merged bottom: the new bottom PR must retarget `main`.
|
|
154
|
+
* Returns false on failure.
|
|
155
|
+
*/
|
|
156
|
+
export async function setPrBase(prNumber: number, base: string): Promise<boolean> {
|
|
157
|
+
try {
|
|
158
|
+
await $`gh pr edit ${prNumber} --base ${base}`.quiet();
|
|
159
|
+
return true;
|
|
160
|
+
} catch {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Get body text for a PR.
|
|
141
167
|
*/
|
|
142
168
|
export async function getPrBody(prNumber: number): Promise<string | null> {
|
|
143
169
|
try {
|