app
app copied to clipboard
Handle case where no all-contributors table exists in file, but `.all-contributorsrc` exists in the repository
Is your feature request related to a problem? Please describe.
The bot currently decides whether to 'init' (install the placeholders for the table and badge) for the README if there is no .all-contributorsrc file. If the file is found, it skips this step. This causes the bot to crash if a user has an .all-contributorsrc file but has nothing else.
Describe the solution you'd like
Handle the case where the .all-contributorsrc file exist, but the contentFiles (READMEs) have not been setup yet.
Describe alternatives you've considered Better documentation?
Additional context Code that determines whether to 'init'/setup/add place holders to contentFiles (READMEs): https://github.com/all-contributors/all-contributors-bot/blob/master/src/tasks/processIssueComment/probot-processIssueComment.js#L50-L53
await contentFiles.fetch(optionsConfig)
if (optionsConfig.getOriginalSha() === undefined) {
contentFiles.init()
}
Table placeholders that are inserted into files during 'init':
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
Having the bot give more useful messages would also already help a lot:

I've been battling with setting this up on the repo over at https://github.com/i0natan/nodebestpractices/issues/410
I believe I am running into this issue (added a .all-contributorsrc file, but it is pointing to a blank file other than README.md). I've tried to manually add the tags to that file, but still running into problems.
So I am keen to take a look into this issue if no-one else has started yet (doesn't look like it)?
All yours :)
Great, looking at it now!
@gr2m (or anyone here) If you have some spare time would you be able to check my approach to this one before I work on fixing the remaining tests? https://github.com/js-kyle/all-contributors-bot/pull/1