add GITEA_USER
This commit is contained in:
parent
6428a6847c
commit
764feb314f
2 changed files with 7 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ First, setup your environment variables like this:
|
|||
export ACCESS_TOKEN=123
|
||||
export GITEA_URL=https://gitea.example.com
|
||||
export GITHUB_TOKEN=456
|
||||
export GITEA_USER=789
|
||||
```
|
||||
|
||||
There are four modes of operation, which the script can print out to the console:
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
# ACCESS_TOKEN = Gitea token
|
||||
# GITERA_URL = Gitea URL
|
||||
# GITHUB_TOKEN = GitHub personal access token
|
||||
# GITEA_USER = Which user creates the repository
|
||||
|
||||
# Displays the given input including "=> " on the console.
|
||||
log () {
|
||||
|
|
@ -114,7 +115,11 @@ set_uid() {
|
|||
|
||||
# Sets the uid to the specified Gitea user
|
||||
set_uid_user() {
|
||||
if [[ -z "${GITEA_USER}" ]]; then
|
||||
uid=$($CURL "${header_options[@]}" $GITEA_URL/api/v1/users/${github_user} | jq .id)
|
||||
else
|
||||
uid=$($CURL "${header_options[@]}" $GITEA_URL/api/v1/users/${GITEA_USER} | jq .id)
|
||||
fi
|
||||
}
|
||||
|
||||
# Fetches all starred repos of the given user to JSON files
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue