Skip to content

Commit

Permalink
🐛 Add temporary bug fix (upptime/upptime#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 17, 2020
1 parent a7087ef commit c6f6376
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/graphs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { join } from "path";
import { exec } from "shelljs";
import { commit, push } from "./git";
import { UpptimeConfig } from "./interfaces";
import { tempFixes } from "./temp";

export const generateGraphs = async () => {
const config = safeLoad(await readFile(join(".", ".upptimerc.yml"), "utf8")) as UpptimeConfig;
exec("npx @upptime/graphs");
exec("npx imagemin-cli graphs/* --out-dir=graphs");
await tempFixes();
commit(
(config.commitMessages || {}).graphsUpdate || ":bento: Update graphs [skip ci]",
(config.commitMessages || {}).commitAuthorName,
Expand Down
18 changes: 18 additions & 0 deletions src/temp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { readdir, readFile, writeFile } from "fs-extra";
import { join } from "path";

export const tempFixes = async () => {
console.log("[warn] Applying temporary fixes");
console.log("[warn] Changing Node.js version in CI");

const workflows = await readdir(join(".", ".github", "workflows"));
for await (const file of workflows) {
if (file.endsWith(".yml")) {
const contents = await readFile(join(".", ".github", "workflows", file), "utf8");
await writeFile(
join(".", ".github", "workflows", file),
contents.replace("actions/[email protected]", "actions/[email protected]")
);
}
}
};

0 comments on commit c6f6376

Please sign in to comment.