Skip to content
Merged
Show file tree
Hide file tree
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
Next Next commit
Parse language before calling getCredentials
  • Loading branch information
mbg committed Oct 8, 2025
commit 2ff418f28a66dd71cd80701e95ec26db12875f15
7 changes: 4 additions & 3 deletions lib/start-proxy-action.js

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

5 changes: 4 additions & 1 deletion src/start-proxy-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Credential,
getCredentials,
getDownloadUrl,
parseLanguage,
UPDATEJOB_PROXY,
} from "./start-proxy";
import {
Expand Down Expand Up @@ -133,11 +134,13 @@ async function runWrapper() {
core.saveState("proxy-log-file", proxyLogFilePath);

// Get the configuration options
const languageInput = actionsUtil.getOptionalInput("language");
const language = languageInput ? parseLanguage(languageInput) : undefined;
const credentials = getCredentials(
logger,
actionsUtil.getOptionalInput("registry_secrets"),
actionsUtil.getOptionalInput("registries_credentials"),
actionsUtil.getOptionalInput("language"),
language,
);

if (credentials.length === 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/start-proxy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ test("getCredentials filters by language when specified", async (t) => {
getRunnerLogger(true),
undefined,
toEncodedJSON(mixedCredentials),
"java",
KnownLanguage.java,
);
t.is(credentials.length, 1);
t.is(credentials[0].type, "maven_repository");
Expand All @@ -120,7 +120,7 @@ test("getCredentials returns all for a language when specified", async (t) => {
getRunnerLogger(true),
undefined,
toEncodedJSON(mixedCredentials),
"go",
KnownLanguage.go,
);
t.is(credentials.length, 2);

Expand Down
3 changes: 1 addition & 2 deletions src/start-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ export function getCredentials(
logger: Logger,
registrySecrets: string | undefined,
registriesCredentials: string | undefined,
languageString: string | undefined,
language: KnownLanguage | undefined,
): Credential[] {
const language = languageString ? parseLanguage(languageString) : undefined;
const registryTypeForLanguage = language
? LANGUAGE_TO_REGISTRY_TYPE[language]
: undefined;
Expand Down