Skip to content

Instantly share code, notes, and snippets.

@hexium310
Last active June 2, 2021 18:20
Show Gist options
  • Save hexium310/a9749ca80687f8a46cb8d7d9438d6221 to your computer and use it in GitHub Desktop.
Save hexium310/a9749ca80687f8a46cb8d7d9438d6221 to your computer and use it in GitHub Desktop.
queryのみが書かれたファイルをgh api graphql --inputでつかうやつ
gh api graphql --input <(jq -n --arg owner hexium310 --arg name brew-uo --arg query "$(cat file | tr '\n' ' ')" '{ query: $query, variables: { owner: $owner, name: $name } }')
query($name: String!, $owner: String!) {
repository(owner: $owner, name: $name) {
releases(last: 3) {
nodes { tagName }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment