probot: context.config() looking in wrong default path

Bug Report

Sometime between v9.4.0 and v9.6.0, using context.config to fetch configuration seems to be looking under the wrong path:

 HttpError: request to https://api.github.com/repos/testOwner/.github/contents/.github/blunderbuss.yml failed, reason: Nock: No match for request {
  "method": "GET",
  "url": "https://api.github.com/repos/testOwner/.github/contents/.github/blunderbuss.yml",
  "headers": {
    "accept": [
      "application/vnd.github.v3+json"
    ],
    "user-agent": [
      "octokit.js/16.33.0 Node.js/11.15.0 (Linux 4.19; x64)"
    ],
    "authorization": [
      "token abc123"
    ],
    "accept-encoding": [
      "gzip,deflate"
    ],
    "connection": [
      "close"
    ]
  }
}

Note that the path is:

.github/contents/.github/blunderbuss.yml

My expectation would be that the path is:

contents/.github/blunderbuss.yml

I have confirmed that the value we are passing to context.config is blunderbuss.yml, here:

      const config = (await context.config(
        CONFIGURATION_FILE_PATH,
        {}
      )) as Configuration;

see: https://github.com/googleapis/repo-automation-bots/pull/132

Current Behavior

Environment

  • Probot version(s): v9.6.0
  • Node/npm version: 11.15.0
  • OS: Debian

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (7 by maintainers)

Most upvoted comments

Issue-Label Bot is automatically applying the label bug 🐞 to this issue, with a confidence of 0.97. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.