Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitea support #8131

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix issue context
  • Loading branch information
anbraten committed Jun 4, 2022
commit 10a6b406c9fd17bee21456ef67a0efdc0119506a
4 changes: 2 additions & 2 deletions components/server/src/gitea/gitea-context-parser.ts
Original file line number Diff line number Diff line change
@@ -422,14 +422,14 @@ export class GiteaContextParser extends AbstractContextParser implements IContex
repoName: string,
nr: number,
): Promise<IssueContext> {
const ctxPromise = this.handleDefaultContext(ctx, user, host, owner, repoName);
const result = await this.giteaApi.run<Gitea.Issue>(user, async (g) => {
return g.repos.issueGetIssue(owner, repoName, nr);
});
if (Gitea.ApiError.is(result) || !result.title || !result.id) {
throw await NotFoundError.create(await this.tokenHelper.getCurrentToken(user), user, host, owner, repoName);
}
const context = await ctxPromise;

const context = await this.handleDefaultContext(ctx, user, host, owner, repoName);
return <IssueContext>{
...context,
title: result.title,