From 0537c5a914a8bf26c6d353a62d0fe387218300ac Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Sun, 26 Nov 2023 19:54:59 +0100 Subject: [PATCH] Added an local rebuilding. --- index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 1806af8..2288073 100644 --- a/index.js +++ b/index.js @@ -98,8 +98,6 @@ async function postCode() { const login_arguments = { token: token, - username: username, - password: password, protocol: protocol, hostname: hostname, port: port, @@ -116,8 +114,12 @@ async function postCode() { core.error(errorMessage); return; } - - const api = new ScreepsAPI(login_arguments); + let api; + if (token) { + api = new ScreepsAPI(login_arguments); + } else { + api = new ScreepsAPI(username, password, login_arguments); + } const response = await api.code.set(branch, files_to_push); core.info(JSON.stringify(response, null, 2)); }