Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails when YAML contains comments #24

Open
agrrh opened this issue Jul 5, 2020 · 1 comment
Open

Fails when YAML contains comments #24

agrrh opened this issue Jul 5, 2020 · 1 comment

Comments

@agrrh
Copy link

agrrh commented Jul 5, 2020

When I add comment to my .drone.yml, plugin fails with:

Files changed: [ '.drone.yml' ]
(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'kind' of null
    at parsedYaml.map (/app/plugin.js:49:12)
    at Array.map (<anonymous>)
    at app.post (/app/plugin.js:48:36)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)

Issue reproduces with following YAML:

# Section 1                     <-- This causes plugin to fail
---

kind: pipeline
type: docker
name: foo

...

# Section 2                     <-- And this, too
---

kind: pipeline
type: docker
name: bar

...
@agrrh
Copy link
Author

agrrh commented Jul 5, 2020

Probably would be fixed by #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant