Skip to content

Instantly share code, notes, and snippets.

@cherryramatisdev
Last active November 28, 2023 14:11
Show Gist options
  • Save cherryramatisdev/fd2581ec97145706ad780fb12d396ee8 to your computer and use it in GitHub Desktop.
Save cherryramatisdev/fd2581ec97145706ad780fb12d396ee8 to your computer and use it in GitHub Desktop.
How to list all the discussions within a repo
#!/usr/bin/env bash
gh api graphql \
-f query="
query {
repository(owner: \"ORG\", name: \"REPO_NAME\") {
discussions(first: 29) {
edges {
node {
title
body
}
}
}
}
}" | jq '.data.repository.discussions.edges' > output.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment