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

Function generate

src/auth.ts:71–108  ·  view source on GitHub ↗
(
  id: string,
  username: string,
  password: string,
  gpgPassphrase?: string | undefined
)

Source from the content-addressed store, hash-verified

69
70// only exported for testing purposes
71export function generate(
72 id: string,
73 username: string,
74 password: string,
75 gpgPassphrase?: string | undefined
76) {
77 const xmlObj: {[key: string]: any} = {
78 settings: {
79 '@xmlns': 'http://maven.apache.org/SETTINGS/1.0.0',
80 '@xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
81 '@xsi:schemaLocation':
82 'http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd',
83 servers: {
84 server: [
85 {
86 id: id,
87 username: `\${env.${username}}`,
88 password: `\${env.${password}}`
89 }
90 ]
91 }
92 }
93 };
94
95 if (gpgPassphrase) {
96 const gpgServer = {
97 id: 'gpg.passphrase',
98 passphrase: `\${env.${gpgPassphrase}}`
99 };
100 xmlObj.settings.servers.server.push(gpgServer);
101 }
102
103 return xmlCreate(xmlObj).end({
104 headless: true,
105 prettyPrint: true,
106 width: 80
107 });
108}
109
110async function write(
111 directory: string,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected