diff --git a/.github/actions/issue-to-hexo/index.js b/.github/actions/issue-to-hexo/index.js index 8548a6e..15538e0 100644 --- a/.github/actions/issue-to-hexo/index.js +++ b/.github/actions/issue-to-hexo/index.js @@ -17,12 +17,12 @@ const generateIssue = async (issue_number) => { const { title, body, created_at, labels, html_url } = issue.data; - const bodyMatch = body.match(//); + const bodyMatch = body.match(//); if (!bodyMatch) { throw new Error(`#${issue_number} has no hexo data`); } - const urlMatch = bodyMatch[1].match(/url: ([\s\S]+?)\r?\n/); + const urlMatch = bodyMatch[2].match(/url: ([\s\S]+?)\r?\n/); if (!urlMatch) { throw new Error(`#${issue_number} has no url`); } @@ -33,7 +33,7 @@ const generateIssue = async (issue_number) => { }) ?.join(`\n`); - const hexoData = `---\ntitle: "${title}"\ndate: "${created_at}"\ncategories:\n${categories}\n${bodyMatch[1]}\n---\n`; + const hexoData = `---\ntitle: "${title}"\ndate: "${created_at}"\ncategories:\n${categories}\n${bodyMatch[2]}\n---\n`; const path = urlMatch[1];