Skip to content

Commit

Permalink
♻️ Format markdown file with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 14, 2020
1 parent 3c3b2b8 commit aea78a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { context, getOctokit } from "@actions/github";
import { GitHub } from "@actions/github/lib/utils";
import { readdir, readFile } from "fs-extra";
import { join } from "path";
import { format } from "prettier";

interface Note {
slug: string;
Expand Down Expand Up @@ -90,7 +91,9 @@ export const run = async () => {
repo: context.repo.repo,
path: "README.md",
});
const base64Content = Buffer.from(readmeContents).toString("base64");
const base64Content = Buffer.from(format(readmeContents.trim(), { parser: "markdown" })).toString(
"base64"
);
if (
Buffer.from(currentContents.data.content, "base64").toString("utf8").trim() !==
readmeContents.trim()
Expand Down

0 comments on commit aea78a2

Please sign in to comment.