diff --git a/.github/workflows/comments.yml b/.github/workflows/comments.yml index 6a765d4..7ad86c2 100644 --- a/.github/workflows/comments.yml +++ b/.github/workflows/comments.yml @@ -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}} @@ -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']) { diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe37790..284ba75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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}} @@ -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, "");