https://github.com/shineii86/galaxybrain
π§ Automate GitHub Galaxy Brain achievement β creates accepted answers in Discussions via GraphQL API. Colab-ready.
https://github.com/shineii86/galaxybrain
achievements automation colab-notebook github python
Last synced: 6 days ago
JSON representation
π§ Automate GitHub Galaxy Brain achievement β creates accepted answers in Discussions via GraphQL API. Colab-ready.
- Host: GitHub
- URL: https://github.com/shineii86/galaxybrain
- Owner: Shineii86
- License: mit
- Created: 2026-04-16T05:21:48.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-23T09:31:52.000Z (about 1 month ago)
- Last Synced: 2026-05-23T11:18:42.263Z (about 1 month ago)
- Topics: achievements, automation, colab-notebook, github, python
- Language: Python
- Homepage:
- Size: 2.32 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/Shineii86/GalaxyBrain)
[](https://colab.research.google.com/github/Shineii86/GalaxyBrain/blob/main/notebooks/GalaxyBrain.ipynb)
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
[](https://github.com/Shineii86/GalaxyBrain/stargazers)
[](https://github.com/Shineii86/GalaxyBrain/fork)
A **fully automated** Python script that runs in **Google Colab** to earn the **Galaxy Brain** achievement by creating accepted answers in GitHub Discussions.
---
> [!WARNING]
> **This script automates interactions with GitHub Discussions to artificially trigger the Galaxy Brain achievement.**
> - **Use responsibly.** Inflating achievements may be viewed negatively by potential employers or collaborators, and may violate GitHub's Terms of Service.
> - You need **Personal Access Tokens (classic)** with `repo` and `write:discussion` scopes for **each account** involved (main + at least two secondaries).
> - The script creates discussions and answers in your repository. **Ensure Discussions are enabled** and a **Q&A category exists**.
> - This tool is intended for **educational purposes and personal experimentation** only.
---
## π Table of Contents
- [What is This Tool?](#-what-is-this-tool)
- [Why Use This Method?](#-why-use-this-method)
- [Prerequisites](#-prerequisites)
- [1. Required Accounts](#1-required-accounts)
- [2. Enable Discussions on Your Repository](#2-enable-discussions-on-your-repository)
- [3. Create a Q&A Category](#3-create-a-qa-category)
- [4. Generate Personal Access Tokens (Classic)](#4-generate-personal-access-tokens-classic)
- [5. Add Secondary Accounts as Collaborators](#5-add-secondary-accounts-as-collaborators)
- [Step-by-Step Guide](#-step-by-step-guide)
- [Configuration Options](#-configuration-options)
- [How It Works](#-how-it-works-technical-overview)
- [Troubleshooting](#-troubleshooting)
- [License & Disclaimer](#-license--disclaimer)
---
## π― What is This Tool?
This tool automates the process of earning the **Galaxy Brain** achievement on GitHub. Galaxy Brain is awarded when a user has **at least two answers marked as accepted** in GitHub Discussions.
Using the **GitHub GraphQL API**, the script:
1. Creates a discussion from a **secondary account**.
2. Posts an answer to that discussion from the **main account** (this is who earns the achievement).
3. Marks that answer as **accepted** using the secondary account.
This process is repeated until the desired number of accepted answers is reached (minimum **2** for the achievement).
> [!NOTE]
> This tool does **not** guarantee immediate achievement unlock. GitHub may take up to 24 hours to update achievement status.
---
## β
Why Use This Method?
| Feature | Benefit |
|------------------------------|-------------------------------------------------------------------------|
| βοΈ **No PC Required** | Runs entirely in Google Colab (cloudβbased). Works on any device with a browser. |
| π **MultiβAccount Support** | Handles up to two secondary accounts (easily extendable). |
| π **Configurable Answers** | Set the exact number of accepted answers you need. |
| π‘οΈ **GraphQL API** | Uses official GitHub APIsβno browser automation or scraping. |
| π¦ **Minimal Dependencies** | Only requires `requests` and standard libraries. |
---
## π§° Prerequisites
### 1. Required Accounts
- **One main GitHub account** β This account will receive the Galaxy Brain achievement.
- **At least two secondary GitHub accounts** β These accounts will post the answers that the main account accepts. You can use existing accounts or create new ones.
### 2. Enable Discussions on Your Repository
1. Go to the repository under your main account.
2. Click **Settings** β **Features**.
3. Under **Discussions**, check **Enable Discussions**.
### 3. Create a Q&A Category
The script requires a discussion category that supports **accepted answers** (Q&A format). If you don't have one, create it:
1. In your repository, go to **Settings** β **Discussions** β **Categories**.
2. Click **New category**.
3. Choose **Q&A** format and give it a name (e.g., "Q&A").
4. Click **Create**.
> The script automatically selects the first answerable category it finds.
### 4. Generate Personal Access Tokens (Classic)
You need a **Personal Access Token (Classic)** for **each account** (main and both secondaries). These tokens grant the script permission to act on behalf of each account.
> [!IMPORTANT]
> **Required scopes for all tokens (main and secondary):**
> - `repo` β Grants full control of private repositories (required for posting answers).
> - `write:discussion` β Grants read/write access to GitHub Discussions.
#### How to Create a Token
For **each account** (main, secondary1, secondary2), repeat these steps:
1. Log in to the account and go to **Settings** β **Developer settings** β **Personal access tokens** β **Tokens (classic)**.
2. Click **Generate new token** β **Generate new token (classic)**.
3. Give it a descriptive **Note** (e.g., `Galaxy Brain Script`).
4. Set an **Expiration** (e.g., 7 days β recommended for security).
5. Under **Select scopes**, check the following boxes:
- βοΈ **repo** (this automatically selects all subβscopes under `repo`)
- βοΈ **write:discussion** (under `write:discussion`)
6. Click **Generate token**.
7. **Copy the token immediately** (it starts with `ghp_`) and store it securely. You will not be able to see it again.
> π **Security Note:** Treat these tokens like passwords. Never commit them to a public repository or share them with anyone.
### 5. Add Secondary Accounts as Collaborators
The secondary accounts must have **write access** to your repository to post answers. You need to invite them as collaborators.
1. Go to your repository (under the main account) β **Settings** β **Collaborators and teams**.
2. Click **Add people** and enter the username of the first secondary account.
3. Click **Add to repository**.
4. Repeat for the second secondary account.
**Accept the Invitation:**
- Log in to each secondary account, go to `https://github.com/YOUR_MAIN_USERNAME/REPO_NAME` or check the email notification, and **accept the invitation**.
> β
**Verification:** You can confirm a secondary account has access by logging into that account and checking if you can see the repository in your list of repositories.
---
## π₯ How to Deploy
### 1οΈβ£ OneβClick Colab
### 2οΈβ£ Fill in the Configuration Form
Inside the Colab notebook, you'll find a single configuration cell with form fields:
| Variable | Description | Example Value |
|-------------------|---------------------------------------------------------------------------|-----------------------------|
| `MAIN_USERNAME` | Your main GitHub handle (to earn the achievement) | `"Shineii86"` |
| `MAIN_TOKEN` | Personal Access Token for main account | `"ghp_abc123..."` |
| `USERNAME_1` | First secondary account handle | `"helper1"` |
| `TOKEN_1` | Personal Access Token for first secondary account | `"ghp_def456..."` |
| `USERNAME_2` | Second secondary account handle | `"helper2"` |
| `TOKEN_2` | Personal Access Token for second secondary account | `"ghp_ghi789..."` |
| `REPO_NAME` | Target repository (must exist under `MAIN_USERNAME`) | `"galaxy-brain-demo"` |
| `NUM_ANSWERS` | Number of accepted answers to create (minimum 2 for Galaxy Brain) | `2` |
| `ACTION_DELAY` | Seconds to wait between API calls (increase to appear more natural) | `5` |
### 3οΈβ£ Run the Notebook
Click **Runtime β Run all** (or press `Ctrl+F9`). The notebook will:
- Install `requests`
- Fetch your repository ID and an answerable category
- For each requested answer:
- Create a discussion (main account)
- Post an answer (secondary account)
- Mark the answer as accepted (main account)
- Display progress and final status
You'll see realβtime output like:
```
π§ Galaxy Brain Automation for user 'Shineii86'
Repository: Shineii86/galaxy-brain-demo
Creating 2 accepted answer(s)
π Fetching repository information...
β
Found repository ID and answerable category: 'Q&A'
--- Processing answer 1 of 2 ---
π€ Secondary account: helper1
π Creating discussion...
π Discussion created: https://github.com/Shineii86/galaxy-brain-demo/discussions/1
π¬ Posting answer as helper1...
π¬ Answer posted by secondary account
β
Marking answer as accepted...
β
Answer marked as accepted
π Answer 1 accepted!
--- Processing answer 2 of 2 ---
...
==================================================
β¨ Success! Created 2 accepted answer(s).
π Check your profile: https://github.com/Shineii86
π Note: Achievements may take up to 24 hours to appear.
```
### 4οΈβ£ Check Your Achievements
1. Go to your GitHub profile: `https://github.com/YOUR_USERNAME`
2. Scroll down to the **Achievements** section (if you already have some) or visit `https://github.com/settings/achievements`.
3. **Galaxy Brain** should appear within 24 hours.
---
## βοΈ Configuration Options
| Parameter | Default | Description |
|------------------|---------|---------------------------------------------------------------------------------------------------------------|
| `MAIN_USERNAME` | β | The GitHub username that will earn the achievement. |
| `MAIN_TOKEN` | β | PAT for the main account with `repo` and `write:discussion` scopes. |
| `USERNAME_1` | β | Username for the first secondary (answerer) account. |
| `TOKEN_1` | β | PAT for the first secondary account with identical scopes. |
| `USERNAME_2` | β | Username for the second secondary account. |
| `TOKEN_2` | β | PAT for the second secondary account. |
| `REPO_NAME` | β | Repository name (under `MAIN_USERNAME`) where discussions will be created. |
| `NUM_ANSWERS` | `2` | Number of accepted answers to create. Set to `2` for Galaxy Brain, or higher for testing. |
| `ACTION_DELAY` | `5` | Delay in seconds between API calls. Increase to `10β15` to mimic human behavior and reduce detection risk. |
### Adding More Secondary Accounts
If you need more than two answers from distinct accounts, you can extend the `secondary_accounts` list inside the script:
```python
secondary_accounts = [
{"username": USERNAME_1, "token": TOKEN_1},
{"username": USERNAME_2, "token": TOKEN_2},
{"username": "helper3", "token": "ghp_..."}, # Add more
]
```
---
## π¬ How It Works (Technical Overview)
The script interacts with the **GitHub GraphQL API v4** using the following mutations:
1. **`createDiscussion`** β Creates a new discussion in the specified repository category.
2. **`addDiscussionComment`** β Posts a comment (answer) to a discussion.
3. **`markDiscussionCommentAsAnswer`** β Marks a comment as the accepted answer.
**Workflow:**
```
βββββββββββββββββββββββ βββββββββββββββββββββββ ββββββββββββββββββββββββ
β Secondary Account ββββββΆβ Create Discussion ββββββΆβ Discussion Created β
βββββββββββββββββββββββ βββββββββββββββββββββββ ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββ βββββββββββββββββββ ββββββββββββββββββββββββ
β Main Account ββββββΆβ Post Answer βββββββ Discussion ID β
βββββββββββββββββββ βββββββββββββββββββ ββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Answer Comment ID β
ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββ βββββββββββββββββββββββββββ
β Secondary Account ββββββΆβ Mark as Accepted β
βββββββββββββββββββββββ βββββββββββββββββββββββββββ
```
> **Note:** The achievement is awarded to whoever **posts** the accepted answer.
> The main account posts answers (and earns Galaxy Brain), while secondaries create discussions and accept them.
All requests are authenticated via `Authorization: Bearer ` headers. Delays between actions help avoid rate limiting and make the activity appear more organic.
---
## π Troubleshooting
| Issue | Solution |
|----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `Repository not found or no access` | Verify the repository name and that your main token has `repo` scope. Ensure the repository exists. |
| `Repository has no discussion categories` | Enable Discussions in repository settings (Settings β Features β Discussions). |
| `GraphQL errors: ... 'does not belong to a discussion in a category that supports answers'` | The discussion category (e.g., "Announcements") does not allow accepted answers. Create a **Q&A** category:
1. Go to `Settings` β `Discussions` β `Categories`.
2. Click **New category**.
3. Choose **Q&A** format and name it (e.g., "Q&A").
4. Save and re-run the script. |
| `GraphQL errors: ...` or `Bad credentials` | Your token is incorrect, expired, or lacks the required scopes (`repo`, `write:discussion`). |
| Secondary account cannot post answer | Ensure the secondary account has accepted the collaborator invitation to the repository. |
| Achievement not appearing after 24 hours | Wait longer (up to 48 hours). Ensure you have **at least two** accepted answers. Check that the answers are still marked as accepted (not unmarked). |
| `Rate limit exceeded` | Increase `ACTION_DELAY` or wait before running again. GitHub's GraphQL rate limit is generous (5,000 points/hour). |
---
## π License & Disclaimer
This project is licensed under the **MIT License** β see the [LICENSE](LICENSE) file for details.
> [!WARNING]
> This script is intended for **educational purposes and personal experimentation** only. Artificially triggering achievements may be viewed negatively by potential employers or collaborators, and may violate GitHub's Terms of Service. The author is not responsible for any consequences arising from misuse of this tool, including but not limited to account suspension, damage to professional reputation, or violation of platform terms.
---
### π Quick Links
- [Google Colab](https://colab.research.google.com/)
- [GitHub Personal Access Tokens](https://github.com/settings/tokens)
- [GitHub GraphQL API Documentation](https://docs.github.com/en/graphql)
- [GitHub Achievements](https://github.com/settings/achievements)
---
## π Loved My Work?
π¨ [Follow me on GitHub](https://github.com/Shineii86)
β [Give a star to this project](https://github.com/Shineii86/GalaxyBrain)
*For inquiries or collaborations*
[](https://telegram.me/Shineii86 "Contact on Telegram")
[](https://instagram.com/ikx7.a "Follow on Instagram")
[](https://pinterest.com/ikx7a "Follow on Pinterest")
[](mailto:ikx7a@hotmail.com "Send an Email")
Copyright Β© 2026 Shinei Nouzen All Rights Reserved
