Skip to content

Commit

Permalink
Always fall back to anonymous download
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed Feb 26, 2025
1 parent 754a7d4 commit 12d6be4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
12 changes: 5 additions & 7 deletions dist/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions src/download/download-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,14 @@ async function getLatestVersion(githubToken: string) {
try {
latestRelease = await getLatestRelease(octokit);
} catch (err) {
if ((err as Error).message.includes("Bad credentials")) {
core.info(
"No (valid) GitHub token provided. Falling back to anonymous. Requests might be rate limited.",
);
const octokit = new PaginatingOctokit();
latestRelease = await getLatestRelease(octokit);
} else {
throw err;
core.info(
"No (valid) GitHub token provided. Falling back to anonymous. Requests might be rate limited.",
);
if (err instanceof Error) {
core.debug(err.message);
}
const octokit = new PaginatingOctokit();
latestRelease = await getLatestRelease(octokit);
}

if (!latestRelease) {
Expand Down

0 comments on commit 12d6be4

Please sign in to comment.