MCPcopy Index your code
hub / github.com/actions/setup-java / configureAuthentication

Function configureAuthentication

src/auth.ts:13–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11import {getBooleanInput} from './util';
12
13export async function configureAuthentication() {
14 const id = core.getInput(constants.INPUT_SERVER_ID);
15 const username = core.getInput(constants.INPUT_SERVER_USERNAME);
16 const password = core.getInput(constants.INPUT_SERVER_PASSWORD);
17 const settingsDirectory =
18 core.getInput(constants.INPUT_SETTINGS_PATH) ||
19 path.join(os.homedir(), constants.M2_DIR);
20 const overwriteSettings = getBooleanInput(
21 constants.INPUT_OVERWRITE_SETTINGS,
22 true
23 );
24 const gpgPrivateKey =
25 core.getInput(constants.INPUT_GPG_PRIVATE_KEY) ||
26 constants.INPUT_DEFAULT_GPG_PRIVATE_KEY;
27 const gpgPassphrase =
28 core.getInput(constants.INPUT_GPG_PASSPHRASE) ||
29 (gpgPrivateKey ? constants.INPUT_DEFAULT_GPG_PASSPHRASE : undefined);
30
31 if (gpgPrivateKey) {
32 core.setSecret(gpgPrivateKey);
33 }
34
35 await createAuthenticationSettings(
36 id,
37 username,
38 password,
39 settingsDirectory,
40 overwriteSettings,
41 gpgPassphrase
42 );
43
44 if (gpgPrivateKey) {
45 core.info('Importing private gpg key');
46 const keyFingerprint = (await gpg.importKey(gpgPrivateKey)) || '';
47 core.saveState(constants.STATE_GPG_PRIVATE_KEY_FINGERPRINT, keyFingerprint);
48 }
49}
50
51export async function createAuthenticationSettings(
52 id: string,

Callers

nothing calls this directly

Calls 2

getBooleanInputFunction · 0.90

Tested by

no test coverage detected