diff --git a/lib/plugins/repository.js b/lib/plugins/repository.js index 2627b39c4..dd88f3607 100644 --- a/lib/plugins/repository.js +++ b/lib/plugins/repository.js @@ -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 { diff --git a/test/unit/lib/plugins/repository.test.js b/test/unit/lib/plugins/repository.test.js index 3ade857b3..9a0dcdfdf 100644 --- a/test/unit/lib/plugins/repository.test.js +++ b/test/unit/lib/plugins/repository.test.js @@ -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'