Skip to content

Commit 75a56a7

Browse files
committed
Add service data to result
1 parent 882a192 commit 75a56a7

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

helpers/result.mjs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export class Result {
2525
this.errorsThrown = []
2626
this.unknownLockFileType = false
2727
this.isValid = false
28+
this.service = null
2829

2930
// Non returned values
3031
this.latestCommitSHA = ''
@@ -52,7 +53,7 @@ export class Result {
5253
this.isIndirect = this.directDependencies.length === 0
5354
this.isValid = this.validate()
5455

55-
return {
56+
const result = {
5657
repoOwner: this.repoOwner,
5758
repoName: this.repoName,
5859
builtByGovernment: this.builtByGovernment,
@@ -66,5 +67,19 @@ export class Result {
6667
unknownLockFileType: this.unknownLockFileType,
6768
isValid: this.isValid
6869
}
70+
if (this.service) {
71+
result.name = this.service.name
72+
result.description = this.service.description
73+
result.synonyms = this.service.synonyms
74+
result.organisation = this.service.organisation
75+
result.phase = this.service.phase
76+
result.theme = this.service.theme
77+
result['start-page'] = this.service.startPage
78+
result.liveservice = this.service.liveservice
79+
result.timeline = this.service.timeline
80+
result.tags = this.service.tags
81+
}
82+
83+
return result
6984
}
7085
}

scripts/build-filtered-data.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export async function analyseRepo (repo) {
6464

6565
result.builtByGovernment = repoData.checkServiceOwner(governmentServiceOwners)
6666

67+
if (governmentServiceOwners[repoOwner]?.[repoName]) {
68+
result.service = governmentServiceOwners[repoOwner][repoName]
69+
}
70+
6771
// Get the repo metadata
6872
const repoInfo = await repoData.getRepoInfo()
6973
Object.assign(result, repoInfo)

0 commit comments

Comments
 (0)