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

Assignees and labels shouldn't be an array #10

Closed
janester opened this issue Apr 30, 2019 · 1 comment · Fixed by #11
Closed

Assignees and labels shouldn't be an array #10

janester opened this issue Apr 30, 2019 · 1 comment · Fixed by #11

Comments

@janester
Copy link

janester commented Apr 30, 2019

👋I want to start off by saying thank you for writing this action 💖 It's super helpful!

BUT, I found a bug when it comes to adding assignees and labels. Although the frontmatter section of issue templates appears to want a real yaml format, listing the assignees and labels as an array instead of a csv string breaks the template and doesn't automatically add the assignees and labels. Also, when you use the "setup templates" wizard from the settings page in the repo, it will generate a file with csv strings, so I had to modify my template to work with this action

- labels: standup
- assignees: bswinnerton, janester, nronas
+ labels: 
+  - standup
+ assignees: 
+  - bswinnerton
+  - janester
+  - nronas

when my action ran with the old csv format, I got this error

For 'properties/assignees', "bswinnerton, janester, nronas" is not an array.
For 'properties/labels', "standup" is not an array.

and then I checked your tests and saw that you are expecting yaml arrays

https://github.com/JasonEtco/create-an-issue/blob/57549108a54d43505e2f3b533685e53ed6f19300/tests/fixtures/.github/kitchen-sink.md

But I think this can be easily fixed by just doing a .split(",") here

create-an-issue/index.js

Lines 36 to 37 in 5754910

assignees: attributes.assignees || [],
labels: attributes.labels || [],

and updating the tests to expect csv strings

cc @JasonEtco

@JasonEtco
Copy link
Owner

Hi @janester! Thank you for the kind words, and for the very helpful details here 🙏 Unfortunately, this is born of a difference between the GitHub.com way of doing things and the GitHub API 😬 From the Issues API docs:

image

So I think a good solution would be to use an array if its already an array, or do like you suggested and .split(','). Will have a PR shortly! ✨

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

Successfully merging a pull request may close this issue.

2 participants