Skip to content

Commit d22c065

Browse files
authored
Fix a bug in fetching sub org repos by custom properties (#792)
* Update settings.js * Fix getRepositoriesByProperty * Update endpoint to use organizationName variable
1 parent 0cb33c8 commit d22c065

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

lib/settings.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -885,21 +885,15 @@ ${this.results.reduce((x, y) => {
885885
const value = propertyFilter[name]
886886

887887
try {
888-
const query = `props.${name}.${value}`
888+
const query = `props.${name}:${value}`
889889
const encodedQuery = encodeURIComponent(query)
890-
891-
return this.github.paginate(
892-
this.github.repos.getCustomPropertiesValues,
893-
{
894-
org: organizationName,
895-
repository_query: encodedQuery,
896-
per_page: 100
897-
}
898-
)
890+
const options = this.github.request.endpoint((`/orgs/${organizationName}/properties/values?repository_query=${encodedQuery}`))
891+
return this.github.paginate(options)
899892
} catch (error) {
900893
throw new Error(`Failed to filter repositories for property ${name}: ${error.message}`)
901894
}
902895
}
896+
903897

904898
async getSubOrgRepositories (subOrgProperties) {
905899
const organizationName = this.repo.owner

0 commit comments

Comments
 (0)