Upload files to "/"
This commit is contained in:
parent
c4d6da9a11
commit
5fc4b9063d
5 changed files with 309 additions and 0 deletions
25
auth-login-logout
Normal file
25
auth-login-logout
Normal file
|
@ -0,0 +1,25 @@
|
|||
# We aren't logged in at the moment, but GH_TOKEN will override the
|
||||
# need to login. We are going to clear GH_TOKEN first to ensure no
|
||||
# overrides are happening
|
||||
|
||||
# Copy $GH_TOKEN to a new env var
|
||||
env LOGIN_TOKEN=$GH_TOKEN
|
||||
|
||||
# Remove GH_TOKEN env var so we don't fall back to it
|
||||
env GH_TOKEN=''
|
||||
|
||||
# Login to the host by feeding the token to stdin
|
||||
exec echo $LOGIN_TOKEN
|
||||
stdin stdout
|
||||
exec gh auth login --hostname=$GH_HOST --with-token --insecure-storage
|
||||
|
||||
# Check that we are logged in
|
||||
exec gh auth status --hostname $GH_HOST
|
||||
stdout $GH_HOST
|
||||
|
||||
# Logout of the host
|
||||
exec gh auth logout --hostname $GH_HOST
|
||||
stderr 'Logged out of'
|
||||
|
||||
# Check that we are logged out
|
||||
! exec gh auth status --hostname $GH_HOST
|
Loading…
Add table
Add a link
Reference in a new issue