Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
Is there a way to accept github invitation as collaborator automatically? Preferably with octokit?

I've been using octokit to fetch github repos and their commits, but I realized that if the repo is private then the person must invite me, and I have to accept that manually every time. I found this as a solution but to be honest I am not sure how I could use it.

This is the method I fetch github repos:

<script type="module">
        import { Octokit } from "https://cdn.pika.dev/@octokit/core";
        
        const octokit = new Octokit({ auth: "*authkey*" });
        octokit.request('GET /repos/:owner/:repo/commits', {
        owner: "*owner*",
        repo: "*repo*"
        }).then(response => console.log(response.data))
    </script>
    

Thank you for your help in advance!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I've never worked with GitHub invitations via API but apparently Octokit offers the option to create an invite, list all existing invites for a user or a repository and accept or decline an invite:

  • https://octokit.github.io/rest.js/v18#repos-accept-invitation
  • https://octokit.github.io/rest.js/v18#repos-list-invitations

I guess you can play with this and get your goal, right?

Also, if you are using GitHub API for a certain group of repositories, I recommend you take a look into https://github.com/octoherd. It offers an easy way to create scripts and re-use existing utilities for interacting with GitHub's API with Octokit.

Let us know if you still have problems with this.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!