Send component description to GitHub

We might as well set the description on the GitHub repo while we're
creating it.
This commit is contained in:
David Tuite
2020-09-15 10:49:27 +01:00
parent f1ca8daee8
commit 1cb1919f0c
2 changed files with 5 additions and 0 deletions
@@ -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;