Initial commit: git-hangman-lab and keycloak-hangman-lab skills
This commit is contained in:
14
git-hangman-lab/scripts/git/generate-access-token
Executable file
14
git-hangman-lab/scripts/git/generate-access-token
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get the directory where this script is located
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
# Verify git credentials first
|
||||
"$SCRIPT_DIR/check-git-cred"
|
||||
|
||||
username=$(pass_mgr get-username --key git)
|
||||
token=$("$SCRIPT_DIR/gitea" admin user generate-access-token --username "$username" --token-name "$username")
|
||||
|
||||
pass_mgr set --key git-access-token --username "$username" --secret "$token"
|
||||
|
||||
echo "Access token generated and stored successfully"
|
||||
Reference in New Issue
Block a user