JasonEtco / create-an-issue

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

Fails to create issue, "can not read a block mapping entry" #84

Closed konstruktoid closed 3 years ago

konstruktoid commented 3 years ago

https://raw.githubusercontent.com/konstruktoid/ansible-role-hardening/master/.github/ISSUE_TEMPLATE.md:

---
name: Lint failure
about: A lint failure issue
title: [ACTION] Linting failed
labels: bug
---
{{ tools.context.actor }}: {{ tools.context.sha }}
Run JasonEtco/create-an-issue@v2
  with:
    filename: .github/ISSUE_TEMPLATE.md
  env:
    GITHUB_TOKEN: ***
⬤  debug     Reading from file .github/ISSUE_TEMPLATE.md
Error: can not read a block mapping entry; a multiline key may not be an implicit key at line 4, column 7:
    labels: bug
          ^
✖  fatal     YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 4, column 7: 
    labels: bug
          ^
    at generateError (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:15156:10)
    at throwError (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:15162:9)
    at readBlockMapping (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16062:9)
    at composeNode (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16348:12)
    at readDocument (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16514:3)
    at loadDocuments (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16577:5)
    at load (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16603:19)
    at safeLoad (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:16626:10)
    at parse (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:12421:20)
    at Object.extractor [as default] (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:12383:12)
JasonEtco commented 3 years ago

Your YAML is invalid, the [ACTION] line needs to be wrapped in quotes or YAML parsers will treat it as an array.

konstruktoid commented 3 years ago

Thank you! Sorry for wasting you time on such a silly thing.

JasonEtco commented 3 years ago

No worries at all - this action should do a better job of making it clear when the error is because the provided YAML is invalid. If you're interested in a PR, that'd be awesome 😁