Skip to content

Commit 9012cd6

Browse files
added PR requested changes
Signed-off-by: Sachin Panayil <sachinpanayil01@gmail.com>
1 parent dea4170 commit 9012cd6

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

js/autoGenerateFields.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function preFillFields(repoData, languages) {
159159
try {
160160
const form = window.formIOInstance
161161

162-
// Updating VCS to git - will always be git
162+
// Updating VCS to git - typically always be git
163163
form.getComponent('vcs').setValue('git')
164164

165165
// Updating organization - only option available
@@ -264,14 +264,16 @@ function preFillFields(repoData, languages) {
264264
}
265265

266266
// Update repositoryHost
267-
if (repoData.html_url.includes('github.cms.gov')) {
268-
form.getComponent('repositoryHost').setValue('github.cms.gov')
269-
} else if (repoData.html_url.includes('github.com/CMSgov')) {
270-
form.getComponent('repositoryHost').setValue('github.com/CMSgov')
271-
} else if (repoData.html_url.includes('github.com/CMS-Enterprise')) {
272-
form.getComponent('repositoryHost').setValue('github.com/CMS-Enterprise')
273-
} else if (repoData.html_url.includes('github.com/DSACMS')) {
274-
form.getComponent('repositoryHost').setValue('github.com/DSACMS')
267+
if (repoData.html_url) {
268+
if (repoData.html_url.includes('github.cms.gov')) {
269+
form.getComponent('repositoryHost').setValue('github.cms.gov')
270+
} else if (repoData.html_url.includes('github.com/CMSgov')) {
271+
form.getComponent('repositoryHost').setValue('github.com/CMSgov')
272+
} else if (repoData.html_url.includes('github.com/CMS-Enterprise')) {
273+
form.getComponent('repositoryHost').setValue('github.com/CMS-Enterprise')
274+
} else if (repoData.html_url.includes('github.com/DSACMS')) {
275+
form.getComponent('repositoryHost').setValue('github.com/DSACMS')
276+
}
275277
}
276278

277279
// fields to potentially automate

0 commit comments

Comments
 (0)