-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathmain.ts
More file actions
26 lines (24 loc) · 854 Bytes
/
main.ts
File metadata and controls
26 lines (24 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import * as core from '@actions/core';
import { JfrogCredentials, Utils } from './utils';
async function main() {
try {
core.startGroup('Setup JFrog CLI');
if (core.getInput(Utils.OIDC_ONLY) !== 'true') {
Utils.setCliEnv();
} else {
core.debug('Skipping CLI env setup as oidc-only is enabled.');
}
let jfrogCredentials: JfrogCredentials = await Utils.getJfrogCredentials();
if (core.getInput(Utils.OIDC_ONLY) !== 'true') {
await Utils.getAndAddCliToPath(jfrogCredentials);
await Utils.configJFrogServers(jfrogCredentials);
} else {
core.debug('Skipping JFrog CLI setup as oidc-only is enabled.');
}
} catch (error) {
core.setFailed((<any>error).message);
} finally {
core.endGroup();
}
}
main();