Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error while reading repo contents #1668

Open
ayushtamra opened this issue Mar 31, 2022 · 1 comment
Open

Getting error while reading repo contents #1668

ayushtamra opened this issue Mar 31, 2022 · 1 comment
Labels

Comments

@ayushtamra
Copy link

Hello developers! I am new with using probot and my experience till now is great, but I am facing problems with something,

So I am trying to read the contents of the github repo, to be more specific the .md files in .github directory of some repository,
For this I am using context.github.repos.getContents() with the path

Code:

async function postWelcome(context) {
  const applicantWelcome = await context.github.repos.getContents(
    context.repo({ path: ".github/applicant-welcome.md" })
  );

Error:

/home/ayush/Desktop/Dev/badging-bot-test/src/postWelcome.js:2
  const applicantWelcome = await context.github.repos.getContents(
                                                ^

TypeError: Cannot read properties of undefined (reading 'repos')
    at postWelcome (/home/ayush/Desktop/Dev/badging-bot-test/src/postWelcome.js:2:49)
    at /home/ayush/Desktop/Dev/badging-bot-test/index.js:14:7
    at /home/ayush/Desktop/Dev/badging-bot-test/node_modules/@octokit/webhooks/dist-node/index.js:177:14
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)
    at async middleware (/home/ayush/Desktop/Dev/badging-bot-test/node_modules/@octokit/webhooks/dist-node/index.js:355:5)

I would be grateful if anyone could help me with this

@welcome
Copy link

welcome bot commented Mar 31, 2022

Thanks for opening this issue. A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines and explore other ways you can get involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants