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