Adding a new rest.get to allow gitea to check if the URL of the repo exists

Signed-off-by: cmoulliard <cmoulliard@redhat.com>
This commit is contained in:
cmoulliard
2024-01-05 16:31:18 +01:00
parent 73295aa0df
commit a6b552b407
@@ -100,6 +100,16 @@ describe('publish:gitea', () => {
}),
);
}),
rest.get(
'https://gitea.com/org1/repo/src/branch/main',
(_req, res, ctx) => {
return res(
ctx.status(200),
ctx.set('Content-Type', 'application/json'),
ctx.json({}),
);
},
),
rest.post('https://gitea.com/api/v1/orgs/org1/repos', (req, res, ctx) => {
// Basic auth must match the user and password defined part of the config
expect(req.headers.get('Authorization')).toBe(
@@ -140,7 +150,7 @@ describe('publish:gitea', () => {
expect(mockContext.output).toHaveBeenCalledWith(
'repoContentsUrl',
'https://gitea.com/org1/repo/src/branch/main',
'https://gitea.com/org1/repo/src/branch/main/',
);
});