mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-05-18 07:04:45 +00:00
Always use api.github.com (#191)
Some checks failed
Check dist/ / check-dist (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Release Drafter / ✏️ Draft release (push) Has been cancelled
test-cache-windows / test-setup-cache (push) Has been cancelled
test-cache / test-setup-cache (push) Has been cancelled
test-cache / test-setup-cache-requirements-txt (push) Has been cancelled
test-cache / test-setup-cache-dependency-glob (push) Has been cancelled
test-cache / test-setup-cache-local (push) Has been cancelled
test-cache / test-tilde-expansion-cache-local-path (push) Has been cancelled
test-cache / test-tilde-expansion-cache-dependency-glob (push) Has been cancelled
test-windows / test-default-version (push) Has been cancelled
test / build (push) Has been cancelled
test / test-default-version (macos-14) (push) Has been cancelled
test / test-default-version (macos-latest) (push) Has been cancelled
test / test-default-version (ubuntu-latest) (push) Has been cancelled
test / test-specific-version (0.3) (push) Has been cancelled
test / test-specific-version (0.3.0) (push) Has been cancelled
test / test-specific-version (0.3.2) (push) Has been cancelled
test / test-specific-version (0.3.x) (push) Has been cancelled
test / test-specific-version (>=0.3.0) (push) Has been cancelled
test / test-semver-range (push) Has been cancelled
test / test-checksum (4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd, ubuntu-latest) (push) Has been cancelled
test / test-checksum (a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218, macos-latest) (push) Has been cancelled
test / test-with-explicit-token (push) Has been cancelled
test / test-uvx (push) Has been cancelled
test / test-tool-install (macos-14) (push) Has been cancelled
test / test-tool-install (macos-latest) (push) Has been cancelled
test / test-tool-install (ubuntu-latest) (push) Has been cancelled
test / test-tool-install (windows-latest) (push) Has been cancelled
test / test-tilde-expansion-tool-dirs (push) Has been cancelled
test / test-python-version (3.12) (push) Has been cancelled
test / test-python-version (3.13t) (push) Has been cancelled
test-cache-windows / test-restore-cache (push) Has been cancelled
test-cache / test-restore-cache (push) Has been cancelled
test-cache / test-restore-cache-requirements-txt (push) Has been cancelled
test-cache / test-restore-cache-dependency-glob (push) Has been cancelled
test-cache / test-restore-cache-local (push) Has been cancelled
test-cache / cleanup-tilde-expansion-tests (push) Has been cancelled
Some checks failed
Check dist/ / check-dist (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Release Drafter / ✏️ Draft release (push) Has been cancelled
test-cache-windows / test-setup-cache (push) Has been cancelled
test-cache / test-setup-cache (push) Has been cancelled
test-cache / test-setup-cache-requirements-txt (push) Has been cancelled
test-cache / test-setup-cache-dependency-glob (push) Has been cancelled
test-cache / test-setup-cache-local (push) Has been cancelled
test-cache / test-tilde-expansion-cache-local-path (push) Has been cancelled
test-cache / test-tilde-expansion-cache-dependency-glob (push) Has been cancelled
test-windows / test-default-version (push) Has been cancelled
test / build (push) Has been cancelled
test / test-default-version (macos-14) (push) Has been cancelled
test / test-default-version (macos-latest) (push) Has been cancelled
test / test-default-version (ubuntu-latest) (push) Has been cancelled
test / test-specific-version (0.3) (push) Has been cancelled
test / test-specific-version (0.3.0) (push) Has been cancelled
test / test-specific-version (0.3.2) (push) Has been cancelled
test / test-specific-version (0.3.x) (push) Has been cancelled
test / test-specific-version (>=0.3.0) (push) Has been cancelled
test / test-semver-range (push) Has been cancelled
test / test-checksum (4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd, ubuntu-latest) (push) Has been cancelled
test / test-checksum (a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218, macos-latest) (push) Has been cancelled
test / test-with-explicit-token (push) Has been cancelled
test / test-uvx (push) Has been cancelled
test / test-tool-install (macos-14) (push) Has been cancelled
test / test-tool-install (macos-latest) (push) Has been cancelled
test / test-tool-install (ubuntu-latest) (push) Has been cancelled
test / test-tool-install (windows-latest) (push) Has been cancelled
test / test-tilde-expansion-tool-dirs (push) Has been cancelled
test / test-python-version (3.12) (push) Has been cancelled
test / test-python-version (3.13t) (push) Has been cancelled
test-cache-windows / test-restore-cache (push) Has been cancelled
test-cache / test-restore-cache (push) Has been cancelled
test-cache / test-restore-cache-requirements-txt (push) Has been cancelled
test-cache / test-restore-cache-dependency-glob (push) Has been cancelled
test-cache / test-restore-cache-local (push) Has been cancelled
test-cache / cleanup-tilde-expansion-tests (push) Has been cancelled
The octokit client would default to the URL of enterprise instances and then not be able to find the uv repo. Closes: #188
This commit is contained in:
parent
884a30e33c
commit
3460fe1a9a
5 changed files with 18 additions and 10 deletions
7
dist/setup/index.js
generated
vendored
7
dist/setup/index.js
generated
vendored
|
@ -98975,7 +98975,7 @@ function resolveVersion(versionInput, githubToken) {
|
||||||
}
|
}
|
||||||
function getAvailableVersions(githubToken) {
|
function getAvailableVersions(githubToken) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const octokit = github.getOctokit(githubToken);
|
const octokit = github.getOctokit(githubToken, { baseUrl: constants_1.GITHUB_COM_API });
|
||||||
const response = yield octokit.paginate(octokit.rest.repos.listReleases, {
|
const response = yield octokit.paginate(octokit.rest.repos.listReleases, {
|
||||||
owner: constants_1.OWNER,
|
owner: constants_1.OWNER,
|
||||||
repo: constants_1.REPO,
|
repo: constants_1.REPO,
|
||||||
|
@ -98985,7 +98985,7 @@ function getAvailableVersions(githubToken) {
|
||||||
}
|
}
|
||||||
function getLatestVersion(githubToken) {
|
function getLatestVersion(githubToken) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const octokit = github.getOctokit(githubToken);
|
const octokit = github.getOctokit(githubToken, { baseUrl: constants_1.GITHUB_COM_API });
|
||||||
const { data: latestRelease } = yield octokit.rest.repos.getLatestRelease({
|
const { data: latestRelease } = yield octokit.rest.repos.getLatestRelease({
|
||||||
owner: constants_1.OWNER,
|
owner: constants_1.OWNER,
|
||||||
repo: constants_1.REPO,
|
repo: constants_1.REPO,
|
||||||
|
@ -99277,10 +99277,11 @@ run();
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.TOOL_CACHE_NAME = exports.OWNER = exports.REPO = void 0;
|
exports.GITHUB_COM_API = exports.TOOL_CACHE_NAME = exports.OWNER = exports.REPO = void 0;
|
||||||
exports.REPO = "uv";
|
exports.REPO = "uv";
|
||||||
exports.OWNER = "astral-sh";
|
exports.OWNER = "astral-sh";
|
||||||
exports.TOOL_CACHE_NAME = "uv";
|
exports.TOOL_CACHE_NAME = "uv";
|
||||||
|
exports.GITHUB_COM_API = "https://api.github.com";
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
5
dist/update-known-checksums/index.js
generated
vendored
5
dist/update-known-checksums/index.js
generated
vendored
|
@ -34685,7 +34685,7 @@ function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const checksumFilePath = process.argv.slice(2)[0];
|
const checksumFilePath = process.argv.slice(2)[0];
|
||||||
const github_token = process.argv.slice(2)[1];
|
const github_token = process.argv.slice(2)[1];
|
||||||
const octokit = github.getOctokit(github_token);
|
const octokit = github.getOctokit(github_token, { baseUrl: constants_1.GITHUB_COM_API });
|
||||||
const response = yield octokit.paginate(octokit.rest.repos.listReleases, {
|
const response = yield octokit.paginate(octokit.rest.repos.listReleases, {
|
||||||
owner: constants_1.OWNER,
|
owner: constants_1.OWNER,
|
||||||
repo: constants_1.REPO,
|
repo: constants_1.REPO,
|
||||||
|
@ -34711,10 +34711,11 @@ run();
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.TOOL_CACHE_NAME = exports.OWNER = exports.REPO = void 0;
|
exports.GITHUB_COM_API = exports.TOOL_CACHE_NAME = exports.OWNER = exports.REPO = void 0;
|
||||||
exports.REPO = "uv";
|
exports.REPO = "uv";
|
||||||
exports.OWNER = "astral-sh";
|
exports.OWNER = "astral-sh";
|
||||||
exports.TOOL_CACHE_NAME = "uv";
|
exports.TOOL_CACHE_NAME = "uv";
|
||||||
|
exports.GITHUB_COM_API = "https://api.github.com";
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
|
@ -2,7 +2,12 @@ import * as core from "@actions/core";
|
||||||
import * as tc from "@actions/tool-cache";
|
import * as tc from "@actions/tool-cache";
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
import { promises as fs } from "node:fs";
|
import { promises as fs } from "node:fs";
|
||||||
import { OWNER, REPO, TOOL_CACHE_NAME } from "../utils/constants";
|
import {
|
||||||
|
GITHUB_COM_API,
|
||||||
|
OWNER,
|
||||||
|
REPO,
|
||||||
|
TOOL_CACHE_NAME,
|
||||||
|
} from "../utils/constants";
|
||||||
import type { Architecture, Platform } from "../utils/platforms";
|
import type { Architecture, Platform } from "../utils/platforms";
|
||||||
import { validateChecksum } from "./checksum/checksum";
|
import { validateChecksum } from "./checksum/checksum";
|
||||||
import * as github from "@actions/github";
|
import * as github from "@actions/github";
|
||||||
|
@ -91,7 +96,7 @@ export async function resolveVersion(
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getAvailableVersions(githubToken: string): Promise<string[]> {
|
async function getAvailableVersions(githubToken: string): Promise<string[]> {
|
||||||
const octokit = github.getOctokit(githubToken);
|
const octokit = github.getOctokit(githubToken, { baseUrl: GITHUB_COM_API });
|
||||||
|
|
||||||
const response = await octokit.paginate(octokit.rest.repos.listReleases, {
|
const response = await octokit.paginate(octokit.rest.repos.listReleases, {
|
||||||
owner: OWNER,
|
owner: OWNER,
|
||||||
|
@ -101,7 +106,7 @@ async function getAvailableVersions(githubToken: string): Promise<string[]> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getLatestVersion(githubToken: string) {
|
async function getLatestVersion(githubToken: string) {
|
||||||
const octokit = github.getOctokit(githubToken);
|
const octokit = github.getOctokit(githubToken, { baseUrl: GITHUB_COM_API });
|
||||||
|
|
||||||
const { data: latestRelease } = await octokit.rest.repos.getLatestRelease({
|
const { data: latestRelease } = await octokit.rest.repos.getLatestRelease({
|
||||||
owner: OWNER,
|
owner: OWNER,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as github from "@actions/github";
|
import * as github from "@actions/github";
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
import { OWNER, REPO } from "./utils/constants";
|
import { GITHUB_COM_API, OWNER, REPO } from "./utils/constants";
|
||||||
import * as semver from "semver";
|
import * as semver from "semver";
|
||||||
|
|
||||||
import { updateChecksums } from "./download/checksum/update-known-checksums";
|
import { updateChecksums } from "./download/checksum/update-known-checksums";
|
||||||
|
@ -10,7 +10,7 @@ async function run(): Promise<void> {
|
||||||
const checksumFilePath = process.argv.slice(2)[0];
|
const checksumFilePath = process.argv.slice(2)[0];
|
||||||
const github_token = process.argv.slice(2)[1];
|
const github_token = process.argv.slice(2)[1];
|
||||||
|
|
||||||
const octokit = github.getOctokit(github_token);
|
const octokit = github.getOctokit(github_token, { baseUrl: GITHUB_COM_API });
|
||||||
|
|
||||||
const response = await octokit.paginate(octokit.rest.repos.listReleases, {
|
const response = await octokit.paginate(octokit.rest.repos.listReleases, {
|
||||||
owner: OWNER,
|
owner: OWNER,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
export const REPO = "uv";
|
export const REPO = "uv";
|
||||||
export const OWNER = "astral-sh";
|
export const OWNER = "astral-sh";
|
||||||
export const TOOL_CACHE_NAME = "uv";
|
export const TOOL_CACHE_NAME = "uv";
|
||||||
|
export const GITHUB_COM_API = "https://api.github.com";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue