mirror of
https://code.forgejo.org/actions/git-backporting.git
synced 2025-05-17 02:59:13 -04:00
feat: add --git-client to explicitly set the type of forge (#106)
codeberg is running Forgejo and it may not be possible to infer that from the URL alone. The same is true for GitHub Enterprise Server.
This commit is contained in:
parent
646d8fe41c
commit
80a0b554f0
11 changed files with 70 additions and 3 deletions
|
@ -768,4 +768,23 @@ describe("gha runner", () => {
|
|||
});
|
||||
expect(GitHubClient.prototype.createPullRequest).toReturnTimes(3);
|
||||
});
|
||||
|
||||
test("explicitly set git client", async () => {
|
||||
spyGetInput({
|
||||
"target-branch": "target",
|
||||
"pull-request": "https://api.github.com/repos/owner/reponame/pulls/2368",
|
||||
"git-client": "codeberg",
|
||||
});
|
||||
|
||||
await runner.execute();
|
||||
|
||||
const cwd = process.cwd() + "/bp";
|
||||
|
||||
expect(GitClientFactory.getOrCreate).toBeCalledTimes(1);
|
||||
expect(GitClientFactory.getOrCreate).toBeCalledWith(GitClientType.CODEBERG, undefined, "https://api.github.com");
|
||||
|
||||
expect(GitCLIService.prototype.clone).toBeCalledTimes(1);
|
||||
expect(GitCLIService.prototype.clone).toBeCalledWith("https://github.com/owner/reponame.git", cwd, "target");
|
||||
});
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue