create-an-issue
create-an-issue copied to clipboard
Add support for mustache templates to assignees
Similar to #119 would it be possible to add support for mustache templates for assignees?
I'm creating a process that automatically assigns a member from my team to an issue by passing the gh user as an environment variable. Maybe I'm missing some existing functionality that might already accomplish this?
This is my current issue_template header:
---
title: Update-stale-article-{{ env.ARTICLE }}
assignees: {{ env.ASSIGNEE }}
labels: article-maintenance
---
This fails with: Error: An error occurred while creating the issue. This might be caused by a malformed issue title, or a typo in the labels or assignees. Check .github/ISSUE_TEMPLATE.md!
In the logs, I can see
title: 'Update-stale-article-{{ env.ARTICLE }}',
assignees: { '[object Object]': null },
labels: 'article-maintenance'
but I know that the env.ASSIGNEE variable has a value because it is used in the body of the issue as well and populates without a problem.
Came here for that 👍
@epiekarski the template does not let you use env vars, but you can just set the assignees directly in the action's yaml file:
with:
assignees: {{ env.ASSIGNEE }}
Please contribute to an active fork! https://github.com/dblock/create-a-github-issue
@JasonEtco are you planning to support template for labels? I know that @dblock forked and implemented it but on the other hand releasing 2.8.1 I see you are active in this repo. Thanks
Hey folks - I'm fine with support templates for labels, assignees, and anything else. PRs welcome! It'd have to look similar to how we're doing the title templating:
https://github.com/JasonEtco/create-an-issue/blob/4cc79e46650462b59761133ac18126b98c5e8a60/src/action.ts#L81-L84
That said: you should be able to use the assignees
input already: https://github.com/JasonEtco/create-an-issue#inputs
There's not an input for labels
, but again I'd be happy to review a PR to add that support 👍