feat: add discussions-migration script#124
Merged
joshjohanning merged 34 commits intomainfrom Oct 6, 2025
Merged
Conversation
📋 Lint Results⚡ ./gh-cli scripts🔧 ./scripts scriptsLint results updated at Mon Oct 6 18:32:53 UTC 2025 |
aff2b2f to
3ec48ef
Compare
3ec48ef to
a78ebd6
Compare
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…r copy-discussions.js" This reverts commit ee1e0cc.
c9f87e0 to
eb3f21a
Compare
… and request limits
…manual retry logic
3d5c516 to
6ea6480
Compare
…limit recommendations
…-discussions - Move script to migrate-discussions/ subdirectory structure - Rename from copy-discussions.js to migrate-discussions.js - Update documentation to reflect migration terminology - Add package.json with octokit dependency - Enhance README with rate limiting and resume features - Update .gitignore to allow nested package.json files
3dd8235 to
39d34ea
Compare
…ify token recommendations
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive Node.js script for migrating GitHub Discussions between repositories across different GitHub instances. The script supports cross-enterprise migrations with automatic rate limit handling, resume capabilities, and preserves discussion content including comments, reactions, polls, and metadata.
Key changes:
- Adds a complete discussions migration solution with Node.js implementation
- Includes comprehensive rate limiting and retry logic with Octokit throttling
- Supports resume functionality and cross-instance migrations
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| scripts/migrate-discussions/package.json | Package configuration for the Node.js migration script with Octokit dependency |
| scripts/migrate-discussions/migrate-discussions.js | Main migration script with GraphQL queries, rate limiting, and comprehensive discussion copying logic |
| scripts/migrate-discussions/README.md | Detailed documentation covering usage, features, configuration options, and examples |
| scripts/README.md | Updated main scripts README to reference the new migrate-discussions script |
Files not reviewed (1)
- scripts/migrate-discussions/package-lock.json: Language not supported
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creating script to copy/migrate discussions between GitHub orgs/repos. Started with a
shellscript, so including that for now, but ultimately because it's so long/complex, moving tonode.TODO
constif you want to or not copy the poll results as mermaid--helpwith(don't want to take another dependency withyargsyargs)Retry-After) and remove manual retry logicNOTES
Usage
For right now, have both Bash and Node.
Example
Final output
SOURCE
Discussion list (note locked and closed translate):

Discussion with comments and child comments:

Discussion with answer:

Discussion with reactions:

Discussion with poll:

TARGET
Discussion list (note locked and closed translate):

Discussion with comments and child comments:

Discussion with answer:

Discussion with reactions:

Discussion with poll:
