This project automates the process of accepting collaborator requests using GitHub Actions. This is especially useful if you receive frequent collaboration invitations and want to streamline the onboarding process.
- Automatically accepts collaborator invitations every 5 minutes.
- Uses GitHub Actions to poll for pending invitations.
- Securely leverages GitHub Personal Access Tokens (PAT).
-If this repo is cloned, you will be skipping step 3 as the workflow will already be inside the clone
-
Navigate to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic).
-
Click Generate new token → Generate new token (classic).
-
Add a Note (e.g.,
Auto Collab Accept). -
Set the Expiration (recommended: 90 days or 180 days).
-
Under Select Scopes, enable the following:
repo→ Full control of private repositories.admin:repo_hook→ Read and write repository hooks.write:repo_hook→ To accept invites.
-
Click Generate Token.
-
Copy the token immediately—you won't be able to see it again.
- Go to your repository on GitHub.
- Navigate to Settings → Secrets and variables → Actions → New repository secret.
- Name the secret PERSONAL_ACCESS_TOKEN.
- Paste the token you copied in Step 1.
- Click Add secret.
-
In the root of your repository, create the following folder structure:
.github/ └── workflows/ └── auto-accept.yml -
Inside
auto-accept.yml, add the following content:name: Auto Accept Collabs on: schedule: - cron: '*/5 * * * *' # Runs every 5 minutes jobs: file_sync: runs-on: ubuntu-latest steps: - name: Fetching Local Repository uses: actions/checkout@v3 - name: Auto Accept Collabs uses: kbrashears5/github-action-auto-accept-collabs@v2.0.0 with: TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- Send a collaborator invite to your GitHub account from another repository.
- Wait 5 minutes for the cron job to execute.
- Check if you have been automatically added to the repository.
- If you see an error like
Missing download info, verify the version (main) of the GitHub Action. Currently this action is running V 2.0.0 - Ensure your
PERSONAL_ACCESS_TOKENis correctly named and has the right permissions. - Check the Action logs for more details if you do not see the auto-accept happening.