GitHub Actions: get username if we don't have it
This commit is contained in:
parent
83d851351a
commit
2735663dc3
@ -341,9 +341,16 @@ module GitHub
|
|||||||
end
|
end
|
||||||
|
|
||||||
def check_fork_exists(repo)
|
def check_fork_exists(repo)
|
||||||
_, username = api_credentials
|
|
||||||
_, reponame = repo.split("/")
|
_, reponame = repo.split("/")
|
||||||
|
|
||||||
|
case api_credentials_type
|
||||||
|
when :keychain
|
||||||
|
_, username = api_credentials
|
||||||
|
when :environment
|
||||||
|
username = open_api(url_to("user")) { |json| json["login"] }
|
||||||
|
end
|
||||||
json = open_api(url_to("repos", username, reponame))
|
json = open_api(url_to("repos", username, reponame))
|
||||||
|
|
||||||
return false if json["message"] == "Not Found"
|
return false if json["message"] == "Not Found"
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user