Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
run: "grep -E '^name\\s*\\:' ./src/blog/ -R > posts.txt && cat posts.txt"
- name: deps
run: |
npm install -g js-yaml
npm install js-yaml
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -30,8 +30,8 @@ jobs:
let title = nameLine.slice(nameLine.indexOf(':')+1).trim();
let labels = ["blog-post"];
let contents = fs.readFileSync(f).toString().trim();
if contents.startsWith('---') {
const [_, metaString, rest] = contents.split('---', 3);
if (contents.startsWith('---')) {
const [_div, metaString, rest] = contents.split('---', 3);
const meta = yaml.load(metaString);
labels = labels.concat(meta['labels'] || []);
if (meta['name']) {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
announce:
runs-on: ubuntu-latest
steps:
- run: npm install -g js-yaml
- run: npm install js-yaml
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -31,7 +31,7 @@ jobs:
if (newBlogPosts.length < 1)
return;

const [_, metaString, _] = newBlogPosts[0].patch.split('---', 3);
const [_div, metaString, _rest] = newBlogPosts[0].patch.split('---', 3);
const meta = yaml.load(metaString);
const releaseName = meta['name'];
const slug = meta['slug'] || releaseName.toLowerCase().replace(/\s+/g, "-").replace(/[^a-zA-Z0-9\-]/g, "");
Expand Down
Loading