mirror of
https://github.com/actions/setup-java.git
synced 2025-07-23 23:18:26 +02:00
Add MTLS credentials setup for maven
Add MTLS setup credentials incldufing GHA parameters to be able to use maven for accessing MTLS protected maven repo
This commit is contained in:
parent
ff0054dfbf
commit
aed95a356a
14 changed files with 23078 additions and 11818 deletions
|
@ -4,6 +4,7 @@ import * as auth from './auth';
|
|||
import * as gpg from './gpg';
|
||||
import * as constants from './constants';
|
||||
import * as path from 'path';
|
||||
import {MavenOpts, isValidOptions} from './maven';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
|
@ -12,6 +13,22 @@ async function run() {
|
|||
version = core.getInput(constants.INPUT_JAVA_VERSION, {required: true});
|
||||
}
|
||||
|
||||
const mvnOpts: MavenOpts = {
|
||||
caCert: core.getInput(constants.INPUT_MAVEN_CA_CERT_B64),
|
||||
keystore: core.getInput(constants.INPUT_MAVEN_KEYSTORE_P12_B64),
|
||||
password: core.getInput(constants.INPUT_MAVEN_KEYSTORE_PASSWORD),
|
||||
settings: core.getInput(constants.INPUT_MAVEN_SETTINGS_B64),
|
||||
securitySettings: core.getInput(
|
||||
constants.INPUT_MAVEN_SECURITY_SETTINGS_B64
|
||||
)
|
||||
};
|
||||
|
||||
if (!isValidOptions(mvnOpts)) {
|
||||
throw new Error(
|
||||
'Some of the Maven options is empty: please check maven-* parameters'
|
||||
);
|
||||
}
|
||||
|
||||
const arch = core.getInput(constants.INPUT_ARCHITECTURE, {required: true});
|
||||
if (!['x86', 'x64'].includes(arch)) {
|
||||
throw new Error(`architecture "${arch}" is not in [x86 | x64]`);
|
||||
|
@ -45,7 +62,13 @@ async function run() {
|
|||
core.setSecret(gpgPrivateKey);
|
||||
}
|
||||
|
||||
await auth.configAuthentication(id, username, password, gpgPassphrase);
|
||||
await auth.configAuthentication(
|
||||
id,
|
||||
username,
|
||||
password,
|
||||
gpgPassphrase,
|
||||
mvnOpts
|
||||
);
|
||||
|
||||
if (gpgPrivateKey) {
|
||||
core.info('importing private key');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue