Skip to content

Commit 02cd024

Browse files
committed
feat: add copy-discussions.sh script for transferring discussions between repositories
1 parent e0662b6 commit 02cd024

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

gh-cli/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,26 @@ Usage:
276276
./check-repository-admin.sh <OWNER> <REPOSITORY> <USERNAME>
277277
```
278278

279+
### copy-discussions.sh
280+
281+
Copies discussions from one repository to another repository using GraphQL API. Supports cross-enterprise copying with different authentication tokens.
282+
283+
Usage:
284+
285+
```shell
286+
./copy-discussions.sh <source_org> <source_repo> <target_org> <target_repo>
287+
```
288+
289+
Prerequisites:
290+
291+
- `SOURCE_TOKEN` environment variable with read access to source repository discussions
292+
- `TARGET_TOKEN` environment variable with write access to target repository discussions
293+
- Both tokens must have the `public_repo` or `repo` scope
294+
- GitHub CLI (gh) must be installed
295+
296+
> [!NOTE]
297+
> This script copies discussion content, comments, replies, and basic metadata. Reactions are not copied. The script will attempt to match discussion categories by name or slug between repositories. Attachments (images and files) will not copy over and require manual handling.
298+
279299
### copy-organization-members.sh
280300

281301
Copy organization members from one organization to the other, the member will **retain** the source role (owner or member), member cannot be demoted, if they already exist at the target with an owner role they cannot be demoted to member.

0 commit comments

Comments
 (0)