-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgh
More file actions
executable file
·26 lines (25 loc) · 697 Bytes
/
gh
File metadata and controls
executable file
·26 lines (25 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if [ ! -d "$HOME/.config" ]
then
mkdir -p $HOME/.config/gh
fi
ssh-add -l &>/dev/null
if [ "$?" != 0 ]
then
docker run -it --rm \
--user $(id -u):$(id -g) \
-v $PWD:/git -w /git \
-v $HOME/.config:/home/bitnami/.config \
-e GITHUB_TOKEN \
michaelin/github-cli:${GH_CLI_VERSION:-latest} \
$*
else
docker run -it --rm \
--user $(id -u):$(id -g) \
-v $PWD:/git -w /git \
-v $HOME/.config:/home/bitnami/.config \
-v $(dirname $SSH_AUTH_SOCK):$(dirname $SSH_AUTH_SOCK) \
-e SSH_AUTH_SOCK=$SSH_AUTH_SOCK \
-e GITHUB_TOKEN \
michaelin/github-cli:${GH_CLI_VERSION:-latest} \
$*
fi