-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement(fern-bot): the bot stops using docker to upgrade generato…
…rs (#1330)
- Loading branch information
1 parent
229967e
commit c637fde
Showing
25 changed files
with
985 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-disable no-console */ | ||
import { SimpleGit } from "simple-git"; | ||
import { DEFAULT_REMOTE_NAME } from "./constants"; | ||
|
||
export async function deleteBranch(git: SimpleGit, branchToDeleteName: string): Promise<void> { | ||
await git.fetch(DEFAULT_REMOTE_NAME, branchToDeleteName); | ||
const deleteResult = await git.branch(["-D", branchToDeleteName]); | ||
// For some reason the API is not typed to return this, but the documentation | ||
// says that it can return a BranchSingleDeleteResult, which is an interface, so we | ||
// cannot do an instance check: | ||
// https://www.npmjs.com/package/simple-git#git-branch | ||
if ("success" in deleteResult) { | ||
console.log(`Deleted branch ${branchToDeleteName}`); | ||
if (deleteResult.success !== true) { | ||
throw new Error("Failed to delete branch, received a failure response: " + JSON.stringify(deleteResult)); | ||
} | ||
} else { | ||
throw new Error("Failed to delete branch, received an unexpected response: " + JSON.stringify(deleteResult)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export { cloneRepository } from "./cloneRepository"; | ||
export { createOrUpdatePullRequest } from "./createOrUpdatePullRequest"; | ||
export { deleteBranch } from "./deleteBranch"; | ||
export { getLatestTag } from "./getLatestTag"; | ||
export { getOrUpdateBranch } from "./getOrUpdateBranch"; | ||
export { parseRepository } from "./parseRepository"; |
Oops, something went wrong.