Added auth for private servers #7

Merged
Philipp merged 30 commits from added-local-auth into main 2023-11-26 22:24:20 +01:00
Showing only changes of commit 6b56c9c937 - Show all commits

View File

@ -118,11 +118,12 @@ async function postCode() {
const response = await api.code.set(branch, files_to_push);
core.info(JSON.stringify(response, null, 2));
} else {
let response;
core.info(`Logging into as user ${username}`);
response = await Promise.resolve()
.then(() => api.auth(username, password, login_arguments))
.then(() => {
core.info(JSON.stringify(api.code.set(branch, files_to_push), null, 2));
response = api.code.set(branch, files_to_push);
})
.then(() => {
console.log(`Code set successfully to ${branch}`);
@ -130,7 +131,7 @@ async function postCode() {
.catch((err) => {
console.error("Error:", err);
});
core.info("Authorized!");
core.info(JSON.stringify(response));
}
}