Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): read github mirror address from environment variable #6196

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix pattern
subframe7536 authored Oct 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 8695139091ac4fb0af8be9fee1656f8293a52bcf
2 changes: 1 addition & 1 deletion lib/core.ps1
Original file line number Diff line number Diff line change
@@ -1355,7 +1355,7 @@ function handle_special_urls($url)
# Github.com
if ($url -match 'github.com/(?<owner>[^/]+)/(?<repo>[^/]+)/releases/download/(?<tag>[^/]+)/(?<file>[^/#]+)(?<filename>.*)') {
if ($gh = $env:GITHUB) {
$url = $url -replace "github.com", $gh
$url = $url -replace "github.com/", "$gh/"
}
if ($token = Get-GitHubToken) {
$headers = @{ "Authorization" = "token $token" }