question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for mustache templates to assignees

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
funes79commented, 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 }}
0reactions
JasonEtcocommented, Dec 23, 2022

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 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support mustache template for title + labels · Issue #74
Issue titles and bodies already support mustache (technically Nunjucks). Is there something specific that isn't working? All reactions.
Read more >
Using Templates
OpenAPI Generator supports user-defined templates. This approach is often the ... Then, we'll add the necessary import to api.mustache .
Read more >
The Joy of Mustache: Server Side Templates for the JVM
I added spring-boot-starter-mustache to my new project, and was up and running within seconds. I want to show you what a neat little...
Read more >
PagerDuty mustache tags | Statuspage
PagerDuty sends data to Statuspage that can be used in Incident Templates via mustache tags. This allows you to “pull-in” additional information from ......
Read more >
Using mustache templates as partial views in Rails 4?
I'm trying to use mustache views in Rails 4 instead of some old partial views that hosted some HTML templates I am sharing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found