Added an await token to the autorization
All checks were successful
Lint / pre-commit Linting (push) Successful in 24s
All checks were successful
Lint / pre-commit Linting (push) Successful in 24s
This commit is contained in:
parent
a312781dc7
commit
ddd15b4063
10
index.js
10
index.js
@ -95,8 +95,6 @@ async function postCode() {
|
|||||||
core.info(`Key: ${key}`);
|
core.info(`Key: ${key}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
core.info(files_to_push);
|
|
||||||
|
|
||||||
const login_arguments = {
|
const login_arguments = {
|
||||||
token: token,
|
token: token,
|
||||||
protocol: protocol,
|
protocol: protocol,
|
||||||
@ -107,9 +105,6 @@ async function postCode() {
|
|||||||
|
|
||||||
core.info("login_arguments:");
|
core.info("login_arguments:");
|
||||||
core.info(JSON.stringify(login_arguments, null, 2));
|
core.info(JSON.stringify(login_arguments, null, 2));
|
||||||
Object.keys(login_arguments).forEach((key) => {
|
|
||||||
core.info(`Key: ${key}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
const errorMessage = validateAuthentication(token, username, password);
|
const errorMessage = validateAuthentication(token, username, password);
|
||||||
if (errorMessage) {
|
if (errorMessage) {
|
||||||
@ -120,9 +115,10 @@ async function postCode() {
|
|||||||
if (token) {
|
if (token) {
|
||||||
api = new ScreepsAPI(login_arguments);
|
api = new ScreepsAPI(login_arguments);
|
||||||
} else {
|
} else {
|
||||||
core.info(`Logging into as usewr ${username}`);
|
core.info(`Logging into as user ${username}`);
|
||||||
api = new ScreepsAPI(login_arguments);
|
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);
|
const response = await api.code.set(branch, files_to_push);
|
||||||
core.info(JSON.stringify(response, null, 2));
|
core.info(JSON.stringify(response, null, 2));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user