JasonEtco / create-an-issue

A GitHub Action for creating a new issue from a template file.
MIT License
258 stars 83 forks source link

Fatal error when calling action #153

Closed austinsasko closed 1 year ago

austinsasko commented 1 year ago

I am encountering the following error when trying to create an issue from a template.

debug     Reading from file update.md
ℹ  info      Front matter for update.md is {
  title: '[Action Required] New {{ env.LATEST_VERSION }} update to requires your attention.',
  assignees: '',
  labels: 'autoupdatenotifier',
  name: 'Workflow Update',
  about: 'For updates to workflow templates'
}
Error: (unknown path) [Line 40, Column 13]
  unexpected token: !
✖  fatal     Template render error: (unknown path) [Line 40, Column 13] 
  unexpected token: !
    at Object._prettifyError (/runner/_work/_actions/actions-ghactions/create-an-issue/ca61fa990d097d7a658ff7db016[81](https://github.com/testing/asasko-test-repo/runs/30019149?check_suite_focus=true#step:5:81)b12b4f02446/dist/index.js:27638:11)
    at Template.render (/runner/_work/_actions/actions-ghactions/create-an-issue/ca61fa9[90](https://github.com/testing/asasko-test-repo/runs/30019149?check_suite_focus=true#step:5:90)d097d7a658ff7db01681b12b4f02446/dist/index.js:25759:21)
    at Environment.renderString (/runner/_work/_actions/actions-ghactions/create-an-issue/ca61fa990d097d7a658ff7db01681b12b4f02446/dist/index.js:25601:17)
    at createAnIssue (/runner/_work/_actions/actions-ghactions/create-an-issue/ca61fa990d097d7a658ff7db01681b12b4f02446/dist/index.js:41259:19)
austinsasko commented 1 year ago

I discovered that using literal strings {{ or }} in the template or body without it being a magic variable substitution causes this issue. Need to escape this by passing {% raw %} before the block and {% endraw %} after