|
1 | | -# GitHub CLI commands |
2 | | -# docs: https://cli.github.com/manual/ |
| 1 | +# GitHub CLI (gh) commands |
| 2 | +# https://cli.github.com/manual/ |
3 | 3 |
|
4 | 4 |
|
5 | | -# list open pull requests |
| 5 | +# show repository info |
6 | 6 | [group: 'gh'] |
7 | | -gh-pr-list: |
8 | | - gh pr list --state open |
| 7 | +gh-repo-view: |
| 8 | + gh repo view |
9 | 9 |
|
10 | 10 |
|
11 | | -# list all pull requests (open and closed) |
| 11 | +# list pull requests |
12 | 12 | [group: 'gh'] |
13 | | -gh-pr-list-all: |
14 | | - gh pr list --state all --limit 20 |
| 13 | +gh-pr-list limit="10": |
| 14 | + gh pr list --limit {{limit}} |
15 | 15 |
|
16 | 16 |
|
17 | | -# view a specific pull request |
| 17 | +# list all pull requests (including closed) |
18 | 18 | [group: 'gh'] |
19 | | -gh-pr-view pr: |
20 | | - gh pr view {{ pr }} |
| 19 | +gh-pr-list-all limit="10": |
| 20 | + gh pr list --state all --limit {{limit}} |
21 | 21 |
|
22 | 22 |
|
23 | | -# close a pull request with comment |
| 23 | +# view specific pull request |
24 | 24 | [group: 'gh'] |
25 | | -gh-pr-close pr comment="Closing PR": |
26 | | - gh pr close {{ pr }} --comment "{{ comment }}" |
| 25 | +gh-pr-view pr_number: |
| 26 | + gh pr view {{pr_number}} |
27 | 27 |
|
28 | 28 |
|
29 | | -# merge a pull request |
| 29 | +# create a new pull request |
30 | 30 | [group: 'gh'] |
31 | | -gh-pr-merge pr: |
32 | | - gh pr merge {{ pr }} |
| 31 | +gh-pr-create: |
| 32 | + gh pr create |
33 | 33 |
|
34 | 34 |
|
35 | | -# list recent workflow runs |
| 35 | +# checkout a pull request locally |
36 | 36 | [group: 'gh'] |
37 | | -gh-run-list: |
38 | | - gh run list --limit 10 |
| 37 | +gh-pr-checkout pr_number: |
| 38 | + gh pr checkout {{pr_number}} |
39 | 39 |
|
40 | 40 |
|
41 | | -# view a specific workflow run |
| 41 | +# list issues |
42 | 42 | [group: 'gh'] |
43 | | -gh-run-view run: |
44 | | - gh run view {{ run }} |
| 43 | +gh-issue-list limit="10": |
| 44 | + gh issue list --limit {{limit}} |
45 | 45 |
|
46 | 46 |
|
47 | | -# view failed logs for a workflow run |
| 47 | +# view specific issue |
48 | 48 | [group: 'gh'] |
49 | | -gh-run-failed run: |
50 | | - gh run view {{ run }} --log-failed |
| 49 | +gh-issue-view issue_number: |
| 50 | + gh issue view {{issue_number}} |
51 | 51 |
|
52 | 52 |
|
53 | | -# watch a workflow run in progress |
| 53 | +# create a new issue |
54 | 54 | [group: 'gh'] |
55 | | -gh-run-watch run: |
56 | | - gh run watch {{ run }} |
| 55 | +gh-issue-create: |
| 56 | + gh issue create |
57 | 57 |
|
58 | 58 |
|
59 | | -# list dependabot security alerts |
| 59 | +# list workflow runs |
60 | 60 | [group: 'gh'] |
61 | | -gh-alerts: |
62 | | - gh api repos/:owner/:repo/dependabot/alerts --jq '.[] | select(.state == "open") | {number, severity: .security_advisory.severity, package: .security_vulnerability.package.name, summary: .security_advisory.summary}' |
| 61 | +gh-run-list limit="10": |
| 62 | + gh run list --limit {{limit}} |
63 | 63 |
|
64 | 64 |
|
65 | | -# list all dependabot alerts (open and fixed) |
| 65 | +# list runs for specific workflow |
66 | 66 | [group: 'gh'] |
67 | | -gh-alerts-all: |
68 | | - gh api repos/:owner/:repo/dependabot/alerts --jq '.[] | {number, state, severity: .security_advisory.severity, package: .security_vulnerability.package.name}' |
| 67 | +gh-run-list-workflow workflow limit="10": |
| 68 | + gh run list --workflow "{{workflow}}" --limit {{limit}} |
69 | 69 |
|
70 | 70 |
|
71 | | -# dismiss a dependabot alert |
| 71 | +# view specific workflow run |
72 | 72 | [group: 'gh'] |
73 | | -gh-alert-dismiss alert reason="not_used": |
74 | | - gh api --method PATCH repos/:owner/:repo/dependabot/alerts/{{ alert }} -f state=dismissed -f dismissed_reason={{ reason }} |
| 73 | +gh-run-view run_id: |
| 74 | + gh run view {{run_id}} |
75 | 75 |
|
76 | 76 |
|
77 | | -# view repository info |
| 77 | +# watch a workflow run in real-time |
78 | 78 | [group: 'gh'] |
79 | | -gh-repo-view: |
80 | | - gh repo view |
| 79 | +gh-run-watch run_id: |
| 80 | + gh run watch {{run_id}} |
| 81 | + |
| 82 | + |
| 83 | +# list GitHub Actions caches |
| 84 | +[group: 'gh'] |
| 85 | +gh-cache-list limit="20": |
| 86 | + gh cache list --limit {{limit}} |
| 87 | + |
| 88 | + |
| 89 | +# delete a specific cache |
| 90 | +[group: 'gh'] |
| 91 | +gh-cache-delete cache_id: |
| 92 | + gh cache delete {{cache_id}} |
| 93 | + |
| 94 | + |
| 95 | +# delete all caches (requires confirmation) |
| 96 | +[group: 'gh'] |
| 97 | +gh-cache-delete-all: |
| 98 | + gh cache delete --all |
| 99 | + |
| 100 | + |
| 101 | +# list workflow files |
| 102 | +[group: 'gh'] |
| 103 | +gh-workflow-list: |
| 104 | + gh workflow list |
| 105 | + |
| 106 | + |
| 107 | +# view workflow file |
| 108 | +[group: 'gh'] |
| 109 | +gh-workflow-view workflow: |
| 110 | + gh workflow view "{{workflow}}" |
| 111 | + |
| 112 | + |
| 113 | +# enable a workflow |
| 114 | +[group: 'gh'] |
| 115 | +gh-workflow-enable workflow: |
| 116 | + gh workflow enable "{{workflow}}" |
| 117 | + |
| 118 | + |
| 119 | +# disable a workflow |
| 120 | +[group: 'gh'] |
| 121 | +gh-workflow-disable workflow: |
| 122 | + gh workflow disable "{{workflow}}" |
| 123 | + |
| 124 | + |
| 125 | +# trigger a workflow manually (workflow_dispatch) |
| 126 | +[group: 'gh'] |
| 127 | +gh-workflow-run workflow: |
| 128 | + gh workflow run "{{workflow}}" |
| 129 | + |
| 130 | + |
| 131 | +# list releases |
| 132 | +[group: 'gh'] |
| 133 | +gh-release-list limit="10": |
| 134 | + gh release list --limit {{limit}} |
| 135 | + |
| 136 | + |
| 137 | +# view latest release |
| 138 | +[group: 'gh'] |
| 139 | +gh-release-view-latest: |
| 140 | + gh release view --latest |
| 141 | + |
| 142 | + |
| 143 | +# create a new release |
| 144 | +[group: 'gh'] |
| 145 | +gh-release-create tag: |
| 146 | + gh release create {{tag}} |
| 147 | + |
| 148 | + |
| 149 | +# list repository secrets |
| 150 | +[group: 'gh'] |
| 151 | +gh-secret-list: |
| 152 | + gh secret list |
| 153 | + |
| 154 | + |
| 155 | +# set a repository secret |
| 156 | +[group: 'gh'] |
| 157 | +gh-secret-set name value: |
| 158 | + echo "{{value}}" | gh secret set {{name}} |
| 159 | + |
| 160 | + |
| 161 | +# delete a repository secret |
| 162 | +[group: 'gh'] |
| 163 | +gh-secret-delete name: |
| 164 | + gh secret delete {{name}} |
| 165 | + |
| 166 | + |
| 167 | +# view repository status (checks, deployments, etc) |
| 168 | +[group: 'gh'] |
| 169 | +gh-status: |
| 170 | + gh status |
| 171 | + |
| 172 | + |
| 173 | +# list repository collaborators |
| 174 | +[group: 'gh'] |
| 175 | +gh-api-collaborators: |
| 176 | + gh api repos/{owner}/{repo}/collaborators |
| 177 | + |
| 178 | + |
| 179 | +# view rate limit status |
| 180 | +[group: 'gh'] |
| 181 | +gh-api-rate-limit: |
| 182 | + gh api rate_limit |
| 183 | + |
| 184 | + |
| 185 | +# clone repository |
| 186 | +[group: 'gh'] |
| 187 | +gh-repo-clone repo: |
| 188 | + gh repo clone {{repo}} |
| 189 | + |
| 190 | + |
| 191 | +# fork repository |
| 192 | +[group: 'gh'] |
| 193 | +gh-repo-fork: |
| 194 | + gh repo fork |
| 195 | + |
| 196 | + |
| 197 | +# sync fork with upstream |
| 198 | +[group: 'gh'] |
| 199 | +gh-repo-sync: |
| 200 | + gh repo sync |
| 201 | + |
| 202 | + |
| 203 | +# browse repository in browser |
| 204 | +[group: 'gh'] |
| 205 | +gh-browse: |
| 206 | + gh browse |
| 207 | + |
| 208 | + |
| 209 | +# browse pull requests in browser |
| 210 | +[group: 'gh'] |
| 211 | +gh-browse-pr: |
| 212 | + gh browse --pulls |
| 213 | + |
| 214 | + |
| 215 | +# browse issues in browser |
| 216 | +[group: 'gh'] |
| 217 | +gh-browse-issues: |
| 218 | + gh browse --issues |
| 219 | + |
| 220 | + |
| 221 | +# browse actions in browser |
| 222 | +[group: 'gh'] |
| 223 | +gh-browse-actions: |
| 224 | + gh browse --actions |
| 225 | + |
| 226 | + |
| 227 | +# browse wiki in browser |
| 228 | +[group: 'gh'] |
| 229 | +gh-browse-wiki: |
| 230 | + gh browse --wiki |
81 | 231 |
|
82 | 232 |
|
83 | | -# open repository in browser |
| 233 | +# list dependabot PRs |
84 | 234 | [group: 'gh'] |
85 | | -gh-repo-browse: |
86 | | - gh repo view --web |
| 235 | +gh-pr-list-dependabot limit="10": |
| 236 | + gh pr list --author app/dependabot --limit {{limit}} |
87 | 237 |
|
88 | 238 |
|
89 | | -# open pull requests page in browser |
| 239 | +# list all dependabot PRs (including closed) |
90 | 240 | [group: 'gh'] |
91 | | -gh-pr-browse: |
92 | | - gh pr list --web |
| 241 | +gh-pr-list-dependabot-all limit="20": |
| 242 | + gh pr list --state all --author app/dependabot --limit {{limit}} |
93 | 243 |
|
94 | 244 |
|
95 | | -# open actions page in browser |
| 245 | +# view GitHub Actions usage (billing) |
96 | 246 | [group: 'gh'] |
97 | | -gh-actions-browse: |
98 | | - gh run list --web |
| 247 | +gh-api-actions-usage: |
| 248 | + gh api repos/{owner}/{repo}/actions/billing/usage |
0 commit comments