Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/plugins/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const ignorableFields = [
'id',
'node_id',
'full_name',
'name',
Comment thread
John15321 marked this conversation as resolved.
Outdated
'private',
'fork',
'created_at',
Expand Down
9 changes: 5 additions & 4 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,11 @@ ${this.results.reduce((x, y) => {

async updateRepos (repo) {
this.subOrgConfigs = this.subOrgConfigs || await this.getSubOrgConfigs()
// Keeping this as is instead of doing an object assign as that would cause `Cannot read properties of undefined (reading 'startsWith')` error
// Copilot code review would recoommend using object assign but that would cause the error
// Create a new object to avoid mutating the shared this.config.repository
// This prevents race conditions when multiple repos are processed concurrently via Promise.all
let repoConfig = this.config.repository
if (repoConfig) {
repoConfig = Object.assign(repoConfig, { name: repo.repo, org: repo.owner })
repoConfig = Object.assign({}, repoConfig, { name: repo.repo, org: repo.owner })
Comment thread
John15321 marked this conversation as resolved.
}

const subOrgConfig = this.getSubOrgConfig(repo.repo)
Expand All @@ -347,7 +347,8 @@ ${this.results.reduce((x, y) => {
if (subOrgConfig) {
let suborgRepoConfig = subOrgConfig.repository
if (suborgRepoConfig) {
suborgRepoConfig = Object.assign(suborgRepoConfig, { name: repo.repo, org: repo.owner })
// Create a new object to avoid mutating the shared subOrgConfig.repository
suborgRepoConfig = Object.assign({}, suborgRepoConfig, { name: repo.repo, org: repo.owner })
repoConfig = this.mergeDeep.mergeDeep({}, repoConfig, suborgRepoConfig)
}
}
Expand Down
Loading