mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
tools: read the upstream project id anonymously
A fine-grained token can be scoped to the fork only; fdroiddata is public, so its project id needs no auth.
This commit is contained in:
@@ -44,7 +44,7 @@ def main [
|
|||||||
error make { msg: "GL_TOKEN is unset; it needs a GitLab token with the 'api' scope" }
|
error make { msg: "GL_TOKEN is unset; it needs a GitLab token with the 'api' scope" }
|
||||||
}
|
}
|
||||||
let headers = { "PRIVATE-TOKEN": $token }
|
let headers = { "PRIVATE-TOKEN": $token }
|
||||||
let upstream_id = (http get $"($api)/projects/($upstream)" --headers $headers | get id)
|
let upstream_id = (http get $"($api)/projects/($upstream)" | get id)
|
||||||
|
|
||||||
let branch_exists = (try { http get $"($api)/projects/($fork)/repository/branches/($branch)" --headers $headers } catch { null }) | is-not-empty
|
let branch_exists = (try { http get $"($api)/projects/($fork)/repository/branches/($branch)" --headers $headers } catch { null }) | is-not-empty
|
||||||
if not $branch_exists {
|
if not $branch_exists {
|
||||||
|
|||||||
Reference in New Issue
Block a user