Created
February 5, 2026 02:17
-
-
Save phpwalter/25fb1d85e8d977e1080bb07fac0eee64 to your computer and use it in GitHub Desktop.
Completly deletes all MILESTONES within a given project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Before running: | |
| 1. Go to your GitHub Settings > Developer Settings > Personal Access Tokens (classic). | |
| [https://github.com/settings/tokens] | |
| 2. GENERATE NEW TOKEN -> GENERATE NEW TOKEN [not classic!] | |
| 3. name it "labels" | |
| 4. Experation: tommorow | |
| 5. Select ONLY SELECT REPOSITORIES: your target repository | |
| 6. + ADD PERMISSIONS | |
| 7. Select ISSUES | |
| NOTE: | |
| For a token to be granted "Read and write" access to Issues | |
| 8. ACCESS: Read and Write | |
| 9. GENERATE TOKEN | |
| 10. Review your settings -> GENERATE TOKENS | |
| 11. Copy token | |
| 12. Paste that token into the YOUR_TOKEN_HERE. | |
| 13. go to your MILESTONES page | |
| [yourname/your_project/milestones/] | |
| 14. Open the browser CONSOLE | |
| 15. paste the modified script | |
| 16. run script and select JSON file | |
| 17. verify it placed issues as expected | |
| Use the sample JSON file to see how this works, than modify the JSON | |
| to add your own issues, desc, etc. | |
| NOTE: | |
| - All fields are required | |
| - DESC must be less than 100 characters | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //DELETE MILESTONES | |
| // 1. CONFIGURATION | |
| // Generate a token at: https://github.com/settings/tokens | |
| // Scope required: 'repo' (or 'public_repo' if public) | |
| const CONFIG = { | |
| token: "YOUR_ACCESS_TOKEN_HERE", | |
| owner: "USERNAME_OR_ORG", | |
| repo: "REPOSITORY_NAME" | |
| }; | |
| // 2. THE SCRIPT | |
| async function nukeMilestones() { | |
| const headers = { | |
| "Authorization": `token ${CONFIG.token}`, | |
| "Accept": "application/vnd.github.v3+json" | |
| }; | |
| try { | |
| console.log("π Fetching milestone list..."); | |
| let milestones = []; | |
| let page = 1; | |
| // Step 1: Fetch ALL milestones (Open AND Closed) | |
| // We must loop to handle pagination if you have >100 milestones | |
| while (true) { | |
| const url = `https://api.github.com/repos/${CONFIG.owner}/${CONFIG.repo}/milestones?state=all&per_page=100&page=${page}`; | |
| const res = await fetch(url, { headers }); | |
| if (!res.ok) throw new Error(`Fetch failed: ${res.status} ${res.statusText}`); | |
| const data = await res.json(); | |
| if (data.length === 0) break; | |
| milestones = milestones.concat(data); | |
| page++; | |
| } | |
| if (milestones.length === 0) { | |
| console.log("β No milestones found to delete."); | |
| return; | |
| } | |
| console.log(`β οΈ Found ${milestones.length} milestones. Starting deletion...`); | |
| // Step 2: Delete one by one | |
| let deletedCount = 0; | |
| for (const ms of milestones) { | |
| console.log(`[${deletedCount + 1}/${milestones.length}] Deleting: "${ms.title}" (ID: ${ms.number})`); | |
| const deleteUrl = `https://api.github.com/repos/${CONFIG.owner}/${CONFIG.repo}/milestones/${ms.number}`; | |
| const delRes = await fetch(deleteUrl, { | |
| method: "DELETE", | |
| headers | |
| }); | |
| if (delRes.ok || delRes.status === 204) { | |
| deletedCount++; | |
| } else { | |
| console.error(`β Failed to delete "${ms.title}": ${delRes.status}`); | |
| } | |
| // Brief pause to be kind to the API | |
| await new Promise(r => setTimeout(r, 300)); | |
| } | |
| console.log(`π Operation Complete: ${deletedCount} milestones deleted.`); | |
| } catch (err) { | |
| console.error("β Error:", err.message); | |
| console.log("Double-check your Token and Repo/Owner names."); | |
| } | |
| } | |
| // 3. RUN | |
| nukeMilestones(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "title": "π [M1] Spec Resolution & Registry", | |
| "description": "\ud83c\udfc1 Milestone 1: The Blueprint\n\n\ud83c\udfaf Objective\nTransform OpenAPI 3.1 YAML into executable intent by resolving all references and building a frozen registry.\n\n\u2705 Definition of Done (DoD)\n- CLI loads a multi-file spec and outputs a registry preview.\n- Resolved `/openapi.json` endpoint serves full spec.\n- All $refs resolved and frozen.\n\n\ud83d\udce6 Acceptance Checks\n- CLI output shows full operation map (paths + security).\n- $ref errors cause readable CLI failure.\n- Registry is immutable after startup.\n\n\ud83d\udd17 Related Exec FRD\n- Contract Integrity\n- Spec Validation\n\n\ud83d\udee0\ufe0f Technical Guardrails\n- Python 3.11+, Pydantic v2\n- JSON Schema 2020-12 support\n- SpecLoader must not mutate spec at runtime.", | |
| "dueOn": "2026-02-06T00:00:00Z" | |
| } | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment