Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion lib/plugins/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ const ignorableFields = [
'force_create',
'auto_init',
'repo',
'archived'
'archived',
// GitHub retired repository Downloads and always returns false here, so comparing
// it would report a change on every sync.
'has_downloads'
]

module.exports = class Repository extends ErrorStash {
Expand Down
15 changes: 15 additions & 0 deletions test/unit/lib/plugins/repository.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ describe('Repository', () => {
})
})

it('does not update a repository whose only difference is has_downloads', () => {
// GitHub retired repository Downloads and always returns has_downloads: false,
// so a config asking for true never matches.
github.rest.repos.get.mockResolvedValueOnce({
data: { name: 'test', has_downloads: false, topics: [] }
})
const plugin = configure({
name: 'test',
has_downloads: true
})
return plugin.sync().then(() => {
expect(github.rest.repos.update).not.toHaveBeenCalled()
})
})

it('handles renames', () => {
const plugin = configure({
name: 'new-name'
Expand Down
Loading