Adjust caches

This commit is contained in:
crazywhalecc 2024-10-04 17:19:38 +08:00 committed by Jerry Ma
parent ecb17cc4c9
commit c09bf1e878
2 changed files with 9 additions and 3 deletions

View File

@ -171,7 +171,7 @@ jobs:
uses: actions/cache@v4
with:
path: downloads
key: php-${{ matrix.php }}-dependencies
key: php-dependencies-${{ matrix.os }}
- name: "Install Dependencies"
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

View File

@ -20,11 +20,17 @@ class CurlHook
}
if (getenv('GITHUB_USER')) {
$auth = base64_encode(getenv('GITHUB_USER') . ':' . getenv('GITHUB_TOKEN'));
$headers[] = "Authorization: Basic {$auth}";
$he = "Authorization: Basic {$auth}";
if (!in_array($he, $headers)) {
$headers[] = $he;
}
logger()->info("using basic github token for {$method} {$url}");
} else {
$auth = getenv('GITHUB_TOKEN');
$headers[] = "Authorization: Bearer {$auth}";
$he = "Authorization: Bearer {$auth}";
if (!in_array($he, $headers)) {
$headers[] = $he;
}
logger()->info("using bearer github token for {$method} {$url}");
}
}