Tried the logout again.
All checks were successful
Lint / pre-commit Linting (push) Successful in 51s
All checks were successful
Lint / pre-commit Linting (push) Successful in 51s
This commit is contained in:
parent
ad5a6efa14
commit
2e271692b0
40
index.js
40
index.js
@ -114,26 +114,26 @@ async function postCode() {
|
||||
return;
|
||||
}
|
||||
let api = new ScreepsAPI(login_arguments);
|
||||
// if (token) {
|
||||
const response = await api.code.set(branch, files_to_push);
|
||||
core.info(JSON.stringify(response, null, 2));
|
||||
//} else {
|
||||
//core.info(`Logging into as user ${username}`);
|
||||
//const response = Promise.resolve()
|
||||
// .then(() => api.auth(username, password))
|
||||
// .then(() => {
|
||||
// return api.code.set(branch, code); // Set the code on the specified branch
|
||||
// })
|
||||
// .then(() => {
|
||||
// console.log("Code set successfully");
|
||||
// // Additional actions after setting the code, if necessary
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.error("Error:", err);
|
||||
// });
|
||||
// core.info("Authorized!");
|
||||
// core.info(JSON.stringify(response, null, 2));
|
||||
// }
|
||||
if (token) {
|
||||
const response = await api.code.set(branch, files_to_push);
|
||||
core.info(JSON.stringify(response, null, 2));
|
||||
} else {
|
||||
core.info(`Logging into as user ${username}`);
|
||||
const response = Promise.resolve()
|
||||
.then(() => api.auth(username, password, login_arguments))
|
||||
.then(() => {
|
||||
return api.code.set(branch, code); // Set the code on the specified branch
|
||||
})
|
||||
.then(() => {
|
||||
console.log("Code set successfully");
|
||||
// Additional actions after setting the code, if necessary
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("Error:", err);
|
||||
});
|
||||
core.info("Authorized!");
|
||||
core.info(JSON.stringify(response, null, 2));
|
||||
}
|
||||
}
|
||||
|
||||
postCode();
|
||||
|
Loading…
x
Reference in New Issue
Block a user