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

Add support for mustache templates to assignees #127

Open
epiekarski opened this issue May 26, 2022 · 5 comments
Open

Add support for mustache templates to assignees #127

epiekarski opened this issue May 26, 2022 · 5 comments

Comments

@epiekarski
Copy link

epiekarski commented May 26, 2022

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.

@melMass
Copy link

melMass commented May 26, 2022

Came here for that 👍

@funes79
Copy link

funes79 commented Jun 20, 2022

@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 }}

@dblock
Copy link
Contributor

dblock commented Sep 1, 2022

Please contribute to an active fork! https://github.com/dblock/create-a-github-issue

@funes79
Copy link

funes79 commented Dec 2, 2022

@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

@JasonEtco
Copy link
Owner

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:

const templated = {
body: env.renderString(body, templateVariables),
title: env.renderString(attributes.title, templateVariables),
};

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 👍

gnzsnz added a commit to gnzsnz/docker-bastion that referenced this issue Aug 16, 2023
remove action JasonEtco/create-an-issue , impacted by unsolved issue JasonEtco/create-an-issue#127
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

5 participants