Added an await token to the autorization
Lint / pre-commit Linting (push) Successful in 24s Details

This commit is contained in:
Philipp Horstenkamp 2023-11-26 20:21:47 +01:00
parent a312781dc7
commit ddd15b4063
Signed by: Philipp
GPG Key ID: DD53EAC36AFB61B4
1 changed files with 3 additions and 7 deletions

View File

@ -95,8 +95,6 @@ async function postCode() {
core.info(`Key: ${key}`);
});
core.info(files_to_push);
const login_arguments = {
token: token,
protocol: protocol,
@ -107,9 +105,6 @@ async function postCode() {
core.info("login_arguments:");
core.info(JSON.stringify(login_arguments, null, 2));
Object.keys(login_arguments).forEach((key) => {
core.info(`Key: ${key}`);
});
const errorMessage = validateAuthentication(token, username, password);
if (errorMessage) {
@ -120,9 +115,10 @@ async function postCode() {
if (token) {
api = new ScreepsAPI(login_arguments);
} else {
core.info(`Logging into as usewr ${username}`);
core.info(`Logging into as user ${username}`);
api = new ScreepsAPI(login_arguments);
api.auth(username, password);
await api.auth(username, password);
core.info("Authorized!");
}
const response = await api.code.set(branch, files_to_push);
core.info(JSON.stringify(response, null, 2));