@@ -21,6 +21,12 @@ go install:
2121go install github.com/sunggun-yu/gh-app-access-token@< version>
2222```
2323
24+ docker:
25+
26+ ``` bash
27+ docker pull ghcr.io/sunggun-yu/gh-app-access-token:latest
28+ ```
29+
2430## Usage
2531
2632### Generate a Github App access token
@@ -57,6 +63,32 @@ echo "private-key-text" | gh-app-access-token generate \
5763 --private-key -
5864```
5965
66+ ### Generate a Github App access toekn using docker image
67+
68+ ``` bash
69+ docker run --rm \
70+ -v < your-github-app-private-key-file-path.pem> :/private-key.pem \
71+ ghcr.io/sunggun-yu/gh-app-access-token:latest \
72+ generate --app-id [app-id] --installation-id [installation-id] -f /private-key.pem
73+ ```
74+
75+ Use environemnt variable: e.g. run it on circleci or github actions
76+
77+ > ⚠️ Note
78+ >
79+ > base64 encoded private key should be set in the environment variable
80+
81+ ``` bash
82+ docker run --rm --entrypoint=" /bin/sh" \
83+ ghcr.io/sunggun-yu/gh-app-access-token:latest \
84+ -c \
85+ " echo -e $GH_APP_PRIVATE_KEY | base64 -d | \
86+ gh-app-access-token generate \
87+ --app-id $GH_APP_ID \
88+ --installation-id $GH_APP_INSTALLATION_ID \
89+ -f -"
90+ ```
91+
6092> ⚠️ Note/Warning
6193>
6294> it keeps waiting(hang) if there is no stdin when you pass ` - ` for arg/value
@@ -77,3 +109,11 @@ echo "access-token-value" | gh-app-access-token-cli revoke -
77109> ⚠️ Note/Warning
78110>
79111> it keeps waiting(hang) if there is no stdin when you pass ` - ` for arg/value
112+
113+ ### Revoke the Github App access token using docker image
114+
115+ ``` bash
116+ docker run --rm \
117+ ghcr.io/sunggun-yu/gh-app-access-token:latest \
118+ revoke [access token string]
119+ ```
0 commit comments