Merge pull request #2470 from RoadieHQ/dtuite/send-description-to-git-hub

Send template description to GitHub
This commit is contained in:
Raghunandan Balachandran
2020-09-17 15:17:49 +02:00
committed by GitHub
3 changed files with 6 additions and 0 deletions
@@ -17,6 +17,7 @@ spec:
schema:
required:
- component_id
- description
properties:
component_id:
title: Name
@@ -147,6 +147,7 @@ describe('GitHub Publisher', () => {
storePath: 'blam/test',
owner: 'bob',
access: 'bob',
description: 'description',
},
directory: '/tmp/test',
});
@@ -154,6 +155,7 @@ describe('GitHub Publisher', () => {
expect(
mockGithubClient.repos.createForAuthenticatedUser,
).toHaveBeenCalledWith({
description: 'description',
name: 'test',
private: false,
});
@@ -61,6 +61,7 @@ export class GithubPublisher implements PublisherBase {
values: RequiredTemplateValues & Record<string, JsonValue>,
) {
const [owner, name] = values.storePath.split('/');
const description = values.description as string;
const user = await this.client.users.getByUsername({ username: owner });
@@ -71,10 +72,12 @@ export class GithubPublisher implements PublisherBase {
org: owner,
private: this.repoVisibility !== 'public',
visibility: this.repoVisibility,
description,
})
: this.client.repos.createForAuthenticatedUser({
name,
private: this.repoVisibility === 'private',
description,
});
const { data } = await repoCreationPromise;