Improving communication with GitHub issue templates
Create templates for issues and pull requests can greatly improve feedback and contributions, especially as an open source project maintainer. We will look specifically at issue templates.
Templates can ask people to provide specific information, or request use of a tool for generating system information (e.g. Spacemacs). Automatic assignment and labelling saves time on issue triage by the project maintainers.
Templates can be created for most shared Git repository services, i.e GitHub, GitLab, BitBucket, etc.
We will discuss what to include in these templates and use GitHub as an example of how to create and edit issue templates.
Creating an issue template
In your GitHub project, open the Settings tab and scroll down to the features section.
Ensure Issues is selected and click on the Set up templates button
Select an existing template to change it or select Custom template to create a new blank template.
Changing an existing template
You can change everything about an existing template, even the name.
Click the pencil icon to edit the template and change as much as you wish.
Click Close preview to finish editing.
The filename will be renamed to the Template name of the issue template once you save
Here is an example of changing the bug to an article template.
Saving the template
Click the Propose changes button to make the change permanent, entering a commit message and committing changes.
Once you commit a template it can be found in the directory .github/ISSUE_TEMPLATE/ directory.
Creating an issue with a template
Click the New issue button to choose a template for a new issue.
All the available templates are now listed when creating a new issue. There is also a link to Edit teamplates if you have access rights on the repository.
There is also a link to create a blank issue.
The issue has the article label and the text of the template, making it simple for a contributor to add information that helps the project maintainer.
A contributor can always choose a different type of issue template before submitting the issue.
Summary
Adding Issue templates is really easy and saves a lot of time getting the basics of communication established between contributors and project maintainers.
Templates minimise the amount of work a project maintainer has to do for each issue and also supports contributors involvement be much more efficient.