mirror of
https://github.com/RGBCube/github2forgejo
synced 2026-01-13 00:31:02 +00:00
fix: don't use URL credentials
This commit is contained in:
parent
1db5512edf
commit
99196bb6e2
1 changed files with 3 additions and 10 deletions
|
|
@ -97,25 +97,18 @@ def main [] {
|
|||
[ $"(ansi green)public(ansi blue)(char space)" $"(ansi red)private(ansi blue)" ] | get ($github_repo.private | into int)
|
||||
) repository (ansi purple)($github_repo.html_url)(ansi blue) to (ansi white_bold)($forgejo_url)/($forgejo_user)/($github_repo.name)(ansi blue)...(ansi reset)"
|
||||
|
||||
let github_repo_url = if not $github_repo.private {
|
||||
$github_repo.html_url
|
||||
} else {
|
||||
$"https://($github_token)@github.com/($github_repo.full_name)"
|
||||
}
|
||||
|
||||
let response = (
|
||||
http post $"($forgejo_url)/api/v1/repos/migrate"
|
||||
--allow-errors
|
||||
-t application/json
|
||||
-H [ Authorization $"token ($forgejo_token)" ]
|
||||
{
|
||||
clone_addr: $github_repo_url
|
||||
({
|
||||
clone_addr: $github_repo.html_url
|
||||
mirror: ($strategy != "cloned")
|
||||
private: $github_repo.private
|
||||
|
||||
repo_owner: $forgejo_user
|
||||
repo_name: $github_repo.name
|
||||
}
|
||||
} | merge (if $github_token != "" { { auth_token: $github_token } } else { {} }))
|
||||
)
|
||||
|
||||
let error_message = ($response | get -i message)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue