Use the correct parameter to create a public repository in Bitbucket Server for the v2 templates

Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
This commit is contained in:
Dominik Henneke
2021-06-15 14:29:01 +02:00
parent 8b971480c0
commit 55a834f3cc
3 changed files with 9 additions and 4 deletions
@@ -140,7 +140,7 @@ describe('publish:bitbucket', () => {
'https://hosted.bitbucket.com/rest/api/1.0/projects/owner/repos',
(req, res, ctx) => {
expect(req.headers.get('Authorization')).toBe('Bearer thing');
expect(req.body).toEqual({ is_private: true, name: 'repo' });
expect(req.body).toEqual({ public: false, name: 'repo' });
return res(
ctx.status(201),
ctx.set('Content-Type', 'application/json'),
@@ -19,10 +19,10 @@ import {
BitbucketIntegrationConfig,
ScmIntegrationRegistry,
} from '@backstage/integration';
import { initRepoAndPush } from '../../../stages/publish/helpers';
import { getRepoSourceDirectory, parseRepoUrl } from './util';
import fetch from 'cross-fetch';
import { initRepoAndPush } from '../../../stages/publish/helpers';
import { createTemplateAction } from '../../createTemplateAction';
import { getRepoSourceDirectory, parseRepoUrl } from './util';
const createBitbucketCloudRepository = async (opts: {
owner: string;
@@ -102,7 +102,7 @@ const createBitbucketServerRepository = async (opts: {
body: JSON.stringify({
name: repo,
description: description,
is_private: repoVisibility === 'private',
public: repoVisibility === 'public',
}),
headers: {
Authorization: authorization,