├── LICENSE ├── README.md └── gh-triage /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Sam 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `gh triage` GitHub CLI extension 2 | 3 | A small [gh](https://github.com/cli/cli) extension for finding issues to be triaged in a GitHub repository. 4 | 5 | ## Installation 6 | ``` 7 | gh extension install samcoe/gh-triage 8 | ``` 9 | 10 | ## Usage 11 | ``` 12 | gh triage [flags] 13 | ``` 14 | 15 | ### Flags 16 | 17 | Supports all options that `gh issue list` supports, except for `--json`, `--jq`, and `--template` which are being utilized by this extension. 18 | 19 | ### Details 20 | 21 | This extensions will list any open issues that are not labeled with any of the following labels: 22 | - p1 23 | - p2 24 | - p3 25 | - core 26 | - help wanted 27 | - tracking issue 28 | - needs-design 29 | - blocked 30 | - needs-user-input 31 | 32 | ## Author 33 | 34 | @samcoe 35 | -------------------------------------------------------------------------------- /gh-triage: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | JSON_FIELDS="createdAt,labels,number,title" 4 | TEMPLATE=' 5 | {{- printf "Showing issues to triage\n\n" -}} 6 | {{- tablerow "ID" "TITLE" "LABELS" "CREATED AT" -}} 7 | {{- range $issue := . -}} 8 | {{- $found := false -}} 9 | {{- range $index, $label := $issue.labels -}} 10 | {{- if not $found -}} 11 | {{- if eq $label.name "p1" "p2" "p3" "core" "help wanted" "tracking issue" "needs-design" "blocked" "needs-user-input" -}} 12 | {{- $found = true -}} 13 | {{- end -}} 14 | {{- end -}} 15 | {{- end -}} 16 | {{- if not $found -}} 17 | {{- $number := printf "#%v" $issue.number | autocolor "green" -}} 18 | {{- $labels := $issue.labels | pluck "name" | join ", " -}} 19 | {{- $timeAgo := timeago $issue.createdAt | autocolor "black+h" -}} 20 | {{- tablerow $number $issue.title $labels $timeAgo -}} 21 | {{- end -}} 22 | {{- end -}} 23 | ' 24 | 25 | exec gh issue list "$@" --json "${JSON_FIELDS}" --template "${TEMPLATE}" 26 | --------------------------------------------------------------------------------