Use the proper repoContentsUrl to access gitea repo and enhance the test case

Signed-off-by: cmoulliard <cmoulliard@redhat.com>
This commit is contained in:
cmoulliard
2024-01-04 18:27:24 +01:00
parent 1a49b1d137
commit 82ae17b19c
2 changed files with 6 additions and 1 deletions
@@ -137,6 +137,11 @@ describe('publish:gitea', () => {
name: undefined,
},
});
expect(mockContext.output).toHaveBeenCalledWith(
'repoContentsUrl',
'https://gitea.com/org1/repo/src/branch/main',
);
});
afterEach(() => {
@@ -330,7 +330,7 @@ export function createPublishGiteaAction(options: {
*/
await sleep(3000);
const repoContentsUrl = `${integrationConfig.config.baseUrl}/${owner}/${repo}/+/refs/${defaultBranch}`;
const repoContentsUrl = `${integrationConfig.config.baseUrl}/${owner}/${repo}/src/branch/${defaultBranch}`;
ctx.output('remoteUrl', remoteUrl);
ctx.output('commitHash', commitResult?.commitHash);
ctx.output('repoContentsUrl', repoContentsUrl);