Skip to content

Commit

Permalink
fix: ensure repoBranch is set from project configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohansebas committed Feb 1, 2025
1 parent deb909d commit b4b837a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/db/build-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ async function * loadProject (octokit, graphQL, project, config, _repo) {
}
}

// Check config for repoBranch
project.repoBranch = project.repoBranch ?? repo.branch

let pkg
try {
pkg = await files.getPackageJson(project)
Expand Down Expand Up @@ -146,7 +149,7 @@ async function * loadProject (octokit, graphQL, project, config, _repo) {
}

try {
for await (const commit of github.getRepoCommits(graphQL, project.repoOwner, project.repoName, repo.branch)) {
for await (const commit of github.getRepoCommits(graphQL, project.repoOwner, project.repoName, project.repoBranch)) {
yield projectDetail('COMMIT', project, commit)
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion lib/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports.Project = class Project {
this.repo = repo
this.repoOwner = repoOwner
this.repoName = repoName
this.repoBranch = proj.repoBranch || 'HEAD'
this.repoBranch = proj.repoBranch
this.repoDirectory = proj.repoDirectory || '/'
this.packageName = null
}
Expand Down

0 comments on commit b4b837a

Please sign in to comment.