Issues and PRs
This page provides an overview of the different components that make up issues and PRs, and includes information about how each component can be used throughout an IssueOps workflow.Issues
Issue permissions
Any user with read access to a repository can open an issue.Issue structure
Component | Description |
---|---|
Title | Title of an issue |
Body | Main content of an issue entered by a user |
Assignees | User(s) responsible for resolving an issue |
Labels | Short tags that can be applied to issues |
Milestones | Groups for issues and PRs |
Relations | Other issues and PRs that are related to this issue |
Development | Branches or PRs linked to the issue |
Projects | Projects that are tracking the issue |
Participants | Users who have interacted with the issue |
Timeline | Events that have occurred on the issue |
Comments | Comments and replies that have been added to the issue |
Reactions | Emoji reactions added to the issue and its comments |
Issue templates vs. issue forms
Currently, GitHub supports both issue templates and issue forms. When creating IssueOps workflows, the initial issue body is where you will get a lot of the information you need to process the issue. Depending on your use-case, issue templates may not result in the desired format, since they allow users to overwrite or replace the entire contents of the issue body during creation. Issue forms require specific input formats and result in a more consistent output.Title
The title of an issue is a short, concise description of the reason the issue has been opened, such as a particular bug or piece of feedback. Typically, the title is the first thing a user will enter when they open an issue (or they may update it based on the initial title provided by the issue form).When creating an issue forms, the title can be used as a way to identify the type of issue. For example, you can use a title like[Request] Team Membership: TEAM_NAME
to indicate that the issue is a request to be added to a team. However, since this field can be modified by users, it should not be used as a way to validate the issue.1title: '[Request] Team Membership: TEAM_NAME'
Body
The body of an issue is where your workflow will get most of the information it needs to process the issue. When creating an issue form, you can use the body to provide instructions to the user, and to collect information from them. For example, you can use a markdown field to provide instructions, and then use an input field to collect the name of the team they would like to join.Markdown
Any
markdown
-type fields in an issue form will not be included in the issue body after it has been submitted by the user.Assignees
Assignees are users who are responsible for resolving an issue. If your workflow involves a review process, you can use assignees to indicate who is responsible for reviewing the issue. You can also use assignees to indicate who is responsible for processing the issue when manual tasks are involved.1assignees:
2 - octocat
3 - mona
Issue vs. PR Assignees
Issues do not support team assignees, but PRs do!
Labels
Labels are a great way to control the flow of an issue through the state(s) you've defined. Any time a issue is commented on or updated, you can use labels to tell where in the flow it is currently, and where it needs to go next.1labels:
2 - issueops:team-membership-request
Milestones
If you have certain timelines or deadlines associated with your workflow, you can use milestones to track them. Milestones are groups of issues and pull requests that are tracked together. They can be used to track:- Due date
- Completion percentage
- Open and closed issues and pull requests
Relations
When creating or commenting on issues, you can reference related issues by using the#
symbol followed by the issue number. For example, if you want to reference issue 1 in another issue in the same repository, you would type #1
.Relations may be useful when your workflow involves multiple issues. For example, if you have a workflow that involves interaction with another team, you can use relations to track the status of the other team's issue.Development
The development section of an issue is where you can track the branches and pull requests that are associated with the issue. This can be useful if your workflow involves creating branches or pull requests for the user. For example, if you would like to create an IssueOps workflow for users to create new repositories and you use an infrastructure as code service such as Terraform, you may want to create a PR on the user's behalf that includes the new repository definition. That way, developers don't have to learn Terraform to get new infrastructure, and operations teams can ensure all infrastructure is created following their requirements.Projects
GitHub Projects are dual-purpose when it comes to IssueOps. They can be used to both track and change the state of an issue. This is especially the case when your workflow involves manual steps that must be performed by a human.As a non-technical example, suppose you're planning Thanksgiving dinner with your extended family. Everyone in the family is supposed to suggest three dishes, prepare them, and bring them on Thanksgiving day.You can open issues for each dish that needs to be prepared using an issue form, and automatically assign them to your meal project.1projects:
2 - octo-repo/1
Within your project, you can specify columns for the state of each dish (e.g. New
, Ingredients purchased
, Ready to cook
, and Cooked
).Manual Interaction
Unfortunately, @mona can't cook (maybe one day!), so you'll need to manually move the issues through the columns as they are assigned and prepared. However, you can use the project to track the state of each dish, and to communicate that state to the rest of the family!
Projects
Participants are users who have interacted with an issue. This includes the user who opened the issue as well as users who have commented on or been assigned to the issue. You can use participants to track who has interacted with an issue, and to communicate with them if needed.Timeline
The timeline is a list of all of the events that have occurred on an issue, starting from when it was first opened. Each timeline event includes a timestamp, the origin of the event, and other useful information.The timeline is especially useful to verify information about an issue. For example, if you have a workflow that requires validation of the issue body, you can (and should!) use labels to mark the issue as validated. However, what happens if a malicious user adds the label manually? You can use the timeline to compare when the issue body was last updated to when the validated label was added. If the label was added before the issue body was updated, you can determine that the label was added manually and re-run your validation logic.ncalteen added
issueops:team-request
1 hour agogithub-actions added
issueops:validated
1 hour agoComments
Other than the issue body, comments are how a user will drive your IssueOps flow. You should define keywords that your workflow looks for to trigger certain actions. Suppose you have a workflow where a user can create a new repository. After the issue has been validated, the user can comment on the issue with a keyword such as.submit
to trigger the creation of their repo.You can also use them to communicate information back to the user. For example, if the issue body contains invalid or incorrect information, you can reply to the issue stating what needs to be corrected. For example, in the screenshot, you can see that a comment was added to the issue because the request was missing information.Reactions
Though they don't convey as much information as a comment, adding reactions to issues and comments are a nice way to let the user know that their input has been received and is being processed. If needed, you can follow up with a comment when processing is complete.Example issue form
Issue form template
1name: Team Membership Request
2description: Submit a request to be added to a GitHub Team
3title: '[Request] Team Membership: TEAM_NAME'
4labels:
5 - issueops:team-membership-request
6assignees:
7 - octocat
8 - mona
9projects:
10 - octo-repo/1
11
12body:
13 - type: markdown
14 attributes:
15 value:
16 Welcome to GitHub! Please fill out the information below to request to
17 be added to a GitHub Team. Once submitted, your request will be reviewed
18 by the admin team. Once approved, you will be added automatically!
19 - type: input
20 id: name
21 attributes:
22 label: Team name
23 description: The name of the team you would like to join.
24 placeholder: octoteam
25 validations:
26 required: true
Rendered output
Pull requests
Pull requests add extra features and metadata on top of issues. Many GitHub APIs support interacting with both at the same time! These additional features, along with examples of how to use them in IssueOps workflows, are listed in the following sections.Pull request permissions
In order to create a pull request, the required permissions will differ based on the location of the branch you wish to merge.Location | Permissions |
---|---|
Same repository (branch) | Write access |
Different repository (fork) | Read access |