Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Feb 12, 2024
1 parent 19658bd commit 2985e0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/make-post-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const core = require("@actions/core");
const fs = require("fs");
const path = require("path");

const postBasePath = "/src/posts";
const postBasePath = "/";
const blogPath = "https://www.oooooroblog.com";
const getPostPath = (filePath) =>
path.join(process.cwd(), postBasePath, filePath);
Expand Down Expand Up @@ -54,7 +54,7 @@ const getAllFilePath = async (dirPath) => {
...(await readFromDirectory(joined)).map((foundName) => [
[dir, name].join("/"),
foundName,
]),
])
);
}
}
Expand Down Expand Up @@ -95,12 +95,12 @@ const postCount = 5;
paths.map(async (filePath) => ({
filePath,
stat: await getFileStat(path.join(process.cwd(), postBasePath, filePath)),
})),
}))
);
const metas = await Promise.all(
fileStats
.map(({ filePath }) => getFileMeta(getPostPath(filePath)))
.filter(Boolean),
.filter(Boolean)
);
const filtered = metas
.sort((a, b) => new Date(b.date) - new Date(a.date))
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/make-post-list.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: make recent post list
on: [push, workflow_dispatch]
jobs:
make:
runs-on: macos-latest
Expand Down

0 comments on commit 2985e0b

Please sign in to comment.