Allow user to select paths to where to store files

This commit is contained in:
Wroclaw 2024-02-21 17:15:21 +01:00
parent fb0022d247
commit b7ff0eaea5
5 changed files with 19 additions and 7 deletions

8
dist/index.js vendored
View file

@ -129103,7 +129103,7 @@ async function main() {
}
const messageIDsConcatenated = messageIDs.join("\n");
core.info(`Messages sent! IDs:\n${messageIDsConcatenated}`);
await promises_1.default.writeFile("./messageIDs.txt", messageIDsConcatenated);
await promises_1.default.writeFile(core.getInput("outputFileLocation"), messageIDsConcatenated);
await Promise.all([
storage_1.default.pushMessageIDs(),
presentMessageIds.map(v => client.deleteMessage(v)),
@ -129169,7 +129169,7 @@ async function getMessageIDs() {
case "none":
return [];
case "git":
return promises_1.default.readFile("./messageIDs.txt")
return promises_1.default.readFile(core.getInput("storageGitFileLocation"))
.then(v => v.toString().trim().split("\n"))
.catch(e => {
core.warning("Couldn't read messageIDs");
@ -129186,9 +129186,11 @@ async function pushMessageIDs() {
const method = getStorageMethod();
switch (method) {
case "git":
const gitFileLocation = core.getInput("storageGitFileLocation", { required: true });
await promises_1.default.copyFile(core.getInput("outputFileLocation"), gitFileLocation);
await exec("git config --global user.name \"Actions\"");
await exec("git config --global user.email \"noreply@users.noreply.github.com\"");
await exec("git add ./messageIDs.txt");
await exec(`git add ${gitFileLocation}`);
await (0, exec_1.exec)("git", ["commit", "-m", "Update stored messageIDs"]);
await exec("git push");
return true;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long