Skip to content

Commit f62f00b

Browse files
committed
Add more GitHub repo information
1 parent 7633c95 commit f62f00b

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

helpers/octokit.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ export async function getRepo (owner, name) {
8686
repository(owner: $owner, name: $name) {
8787
createdAt
8888
updatedAt
89+
description
90+
homepage
91+
archived
92+
watchers_count
93+
forks_count
8994
defaultBranchRef {
9095
target {
9196
... on Commit {

helpers/repo-data.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ export class RepoData {
7676
const result = {
7777
createdAt: response.repository?.createdAt,
7878
updatedAt: response.repository?.updatedAt,
79+
description: response.repository?.description,
80+
homepage: response.repository?.homepage,
81+
archived: response.repository?.archived,
82+
watchersCount: response.repository?.watchers_count,
83+
forksCount: response.repository?.forks_count,
7984
latestCommitSHA: response.repository?.defaultBranchRef?.target?.oid,
8085
graphQLRateLimit: response.rateLimit
8186
}

helpers/result.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export class Result {
1515
}
1616
this.repoOwner = repoOwner
1717
this.repoName = repoName
18+
this.description = ''
19+
this.homepage = ''
20+
this.archived = false
21+
this.watchersCount = 0
22+
this.forksCount = 0
1823
this.builtByGovernment = false
1924
this.isPrototype = false
2025
this.updatedAt = ''
@@ -55,6 +60,11 @@ export class Result {
5560
const result = {
5661
repoOwner: this.repoOwner,
5762
repoName: this.repoName,
63+
description: this.description,
64+
homepage: this.homepage,
65+
archived: this.archived,
66+
watchersCount: this.watchersCount,
67+
forksCount: this.forksCount,
5868
builtByGovernment: this.builtByGovernment,
5969
updatedAt: this.updatedAt,
6070
createdAt: this.createdAt,
@@ -68,7 +78,7 @@ export class Result {
6878
}
6979
if (this.service) {
7080
result.name = this.service.name
71-
result.description = this.service.description
81+
result['service-description'] = this.service.description
7282
result.synonyms = this.service.synonyms
7383
result.organisation = this.service.organisation
7484
result.phase = this.service.phase

0 commit comments

Comments
 (0)