Comments (18)
So I didn't actually get around to this until now, but given the month of October approaching, I'm gonna open this up to any hacktoberfest hackers! π€
The edits to code basically need to check that:
- if a
.github/ISSUE_TEMPLATE.md
exists, get it's contents, the code for that might look something like:
const res = await context.github.repos.getContent(this.repo({path: '.github/ISSUE_TEMPLATE.md'}))
const issueTemplate = Buffer.from(res.data.content, 'base64').toString()
- and it matches exactly the body of the issue opened
- (There's a number of ways to do this, but I'll suggest a simple way) create a variable
issueTemplateCopied
and setting it to true if thebody
of the issue matches that of the.github/ISSUE_TEMPLATE.md
. - Amend the following code:
Line 21 in d629c8a
to beif (!body || badTitle || issueTemplateCopied) {
That should be it! Feel free to comment here if you have any questions.
from request-info.
@codebytere awesome! If you wanna try your hand at implementing some sort of checking to see if the issue template was actually filled out, feel free!
from request-info.
I still think this is outstanding and requires considering a repository might define multiple templates in .github/ISSUE_TEMPLATE
. I started on this in #39 and would love feedback to ensure I'm on the right track.
from request-info.
Hi @j-f1, thanks for the feedback!
Issue templates was definitely something I considered when creating the bot. There is a bot built by @kytrinyx that closes issues that do not fill out the issue template. This app although specifically designed for one repo, could easily be made configurable and close issues that don't fill out any issue template fields. So this could definitely be done.
An even more awesome feature would be to check if there are any fields in the template that need to be filled out, then ask the user to fill them out.
This could be a little more difficult to accomplish. The main problem I wouldn't be sure about would be determining what fields are missing? Most issue templates are just text, using your example, but a bit shortened:
Description
[Description of the issue]
OS version: [version here]
Steps to Reproduce
1. [First step]
2. [Second step]
3. [and so on]
Expected behavior: [What you expected to happen]
How would the bot determine what fields are missing? If there is no text in between Description
and OS version
? In between each number? What if your use case only takes 2 steps to reproduce? In some issue templates, certain fields are optional, and I haven't seen a standardized way of displaying that.
I think that @lee-dohm was actually interested in making a github app to solve this problem using some comparison of the original issue template to the body of the issue. Do you think request-info
would be a good place for that to live?
Basically, I think this might be difficult to make work for many different issue templates, but I'd be +1 for adding the comment as well if the issue template wasn't edited at all.
from request-info.
That could work, I was thinking before assuming we base this only off of information from the issue template. But where would the above live? In a .github/config.yml
file? It's somewhat inconvenient because then what if you change your issue template and forget to update the config file?
from request-info.
π, letβs abandon the template-checking idea and just check for strict equality.
from request-info.
π I'll implement this shortly :)
from request-info.
Thanks for opening this issue, a maintainer will get back to you shortly!
from request-info.
Maybe something like this:
boilerplate:
delimiters:
- "["
- "]"
fields:
- description of the issue
- version here
- first step
- second step
- and so on
- what you expected to happen
It would search for [description of the issue]
, [version here]
, etc.
from request-info.
@hiimbex yo yo the electron team might be able to make some good use of this π i'll take a swing at it soonish
from request-info.
@codebytere Have you had a chance to do this yet? If youβre busy, I can try to implement the feature this weekend.
from request-info.
I don't think anyone is desperate to implement this for hacktoberfest reasons, so whoever gets around to it first is fine with me! @j-f1 I'd say go for it! (Also if it's not implemented soonish, I can just do it too, I've just been busy lately)
from request-info.
Yeah i can probably get to it this weekend since our need for it has increased recently
from request-info.
I've created a bot similar to this, but checks for incomplete tasklists and keywords from the config file that should be in each issue. Not exactly looking at the issue template, but could go there eventually. https://github.com/szeck87/issue-complete
from request-info.
Heyy, I would love to fix this one for you. π
from request-info.
Believe this was done with #32
from request-info.
Thanks @szeck87
from request-info.
actually I think #32 applied to pull request templates, not issue templates. But there is already an open or for this issue.
from request-info.
Related Issues (20)
- Swap to standard linting HOT 1
- Add users to exclude from prompting HOT 2
- Multiple random messages HOT 3
- feature request: check body by REGEX HOT 9
- Ability to forbid generated title for edits done on github HOT 6
- Comments on trivial changes HOT 4
- Default config causes an error HOT 2
- config file conflict HOT 6
- Unclear how to resolve a requestInfoReplyComment for instance in the case of a verbose title and no body HOT 8
- Making the bot reply with the request info comment after manually adding a label manually HOT 5
- [Question] What's the correct format I should use for the label? HOT 4
- Resource not accessible by integration HOT 10
- Silently fails without a .github/config.yml file HOT 1
- Testing WIP HOT 1
- Doesn't work HOT 1
- Organization wide configuration HOT 1
- Pull Request Template Not Getting Checked HOT 3
- confing.yml change
- Add a default text HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from request-info.