Skip to content

Commit 98ac2e7

Browse files
author
Bassem Dghaidi
authored
Merge pull request #9 from Link-/gh-cli-extension
gh cli extension compatibility
2 parents 3358879 + d407669 commit 98ac2e7

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
> Create an installation access token for a GitHub app from your terminal
1111
12-
[![ghtoken size](https://img.shields.io/github/size/link-/github-app-bash/ghtoken?style=flat-square)](ghtoken) [![License](https://img.shields.io/github/license/link-/github-app-bash?style=flat-square)](LICENSE) ![platforms supported](https://img.shields.io/static/v1?style=flat-square&label=platform&message=macos%20%7C%20linux)
12+
[![ghtoken size](https://img.shields.io/github/size/link-/gh-token/ghtoken?style=flat-square)](ghtoken) [![License](https://img.shields.io/github/license/link-/gh-token?style=flat-square)](LICENSE) ![platforms supported](https://img.shields.io/static/v1?style=flat-square&label=platform&message=macos%20%7C%20linux)
1313
1414
[Creates an installation access token](https://docs.github.com/en/rest/reference/apps#create-an-installation-access-token-for-an-app) that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire 1 hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token.
1515

@@ -44,14 +44,14 @@ With an access token generated with a GitHub App you don't have to worry about t
4444
- `jq`
4545
- `shasum`
4646
47-
Download `ghtoken` [from the main branch](https://github.com/Link-/github-app-bash/blob/main/ghtoken)
47+
Download `ghtoken` [from the main branch](https://github.com/Link-/gh-token/blob/main/gh-token)
4848
4949
### wget
5050
5151
```sh
5252
# Download a file, name it ghtoken then do a checksum
5353
wget -O ghtoken \
54-
https://raw.githubusercontent.com/Link-/github-app-bash/main/ghtoken && \
54+
https://raw.githubusercontent.com/Link-/gh-token/main/gh-token && \
5555
echo "11630050d3859d7fcaa42fad08c184cfe2ceeb3887779dc76394c4dba80903ef ghtoken" | \
5656
shasum -c - && \
5757
chmod u+x ./ghtoken
@@ -65,12 +65,25 @@ wget -O ghtoken \
6565
# do a checksum
6666
curl -o ghtoken \
6767
-O -L -C - \
68-
https://raw.githubusercontent.com/Link-/github-app-bash/main/ghtoken && \
68+
https://raw.githubusercontent.com/Link-/gh-token/main/gh-token && \
6969
echo "11630050d3859d7fcaa42fad08c184cfe2ceeb3887779dc76394c4dba80903ef ghtoken" | \
7070
shasum -c - && \
7171
chmod u+x ./ghtoken
7272
```
7373
74+
### gh cli extension
75+
76+
You can install `ghtoken` as a [gh cli](https://github.com/cli/cli) extension!
77+
78+
```sh
79+
gh extensions install Link-/gh-token
80+
81+
# Verify installation
82+
gh token
83+
```
84+
85+
All the commands and parameters remain the same, the only different is you now can use `gh token` instead of `ghtoken`.
86+
7487
### Creating a GitHub App
7588
7689
Follow [these steps](https://docs.github.com/en/developers/apps/creating-a-github-app)
@@ -362,7 +375,7 @@ jobs:
362375
run: |
363376
curl -o ghtoken \
364377
-O -L -C - \
365-
https://raw.githubusercontent.com/Link-/github-app-bash/main/ghtoken && \
378+
https://raw.githubusercontent.com/Link-/gh-token/main/gh-token && \
366379
echo "11630050d3859d7fcaa42fad08c184cfe2ceeb3887779dc76394c4dba80903ef ghtoken" | \
367380
shasum -c - && \
368381
chmod u+x ./ghtoken
@@ -428,6 +441,7 @@ _These are not endorsements, just a listing of similar art work_
428441
429442
### CLI
430443
444+
- [apptokit](https://github.com/jakewilkins/apptokit) in Ruby
431445
- [gha-token](https://github.com/slawekzachcial/gha-token) in Go
432446
433447
### Actions

ghtoken renamed to gh-token

File renamed without changes.

0 commit comments

Comments
 (0)