GitHub Actions is a workflow automation feature from GitHub that allows developers to create custom workflows directly in their code repositories to automate CI/CD pipelines, code linting, unit testing, and more. GitHub Actions helps developers streamline their software development processes, ensure that code meets their organization’s standards, and seamlessly deploy code to production environments. The GitHub Marketplace contains a plethora of Actions you can add to your repo to automate a wide range of tasks.

This article will focus gitStream, a workflow automation tool that uses YAML to optimize your code review process.gitStream can automatically apply and manage PR labels, identify and auto-assign code reviewers, and auto-merge PRs to unblock the development process and maximize developer productivity.

CI Orchestration

One of the most powerful ways gitStream can automate GitHub actions is through CI Orchestration. With gitStream, you will no longer be required to run all CI services for every PR, reducing the amount of time your team spends waiting on things to finish so you can spend more time on productive work. 

With gitStream, you can skip unnecessary status checks for PRs that don’t affect code that is relevant to that CI pipeline and trigger them only when necessary.

dispatch_github_action.png

Learn how to use gitStream to orchestrate your GitHub Actions workflows.

Automatic Label Management

There are quite a few options on the GitHub Actions marketplace for managing PR labels, however, they all come with various limitations that are either challenging or even impossible to work around. gitStream makes it extremely simple to create custom rules for applying labels that take a variety of inputs to better set context.

For example, gitStream is capable of estimating the amount of time a PR will take to review and can automatically apply labels to the PR that indicate a precise number of minutes. Most other automatic PR labeling workflows rely on one-size-fits all approaches that don’t always account for the complexity of every component that is changes. Read the docs for estimated time to review labels.

ApplyETRLabel(Light)-AutomationOnly (1).png

gitStream can also identify the resources that a PR changes and automatically apply labels that indicate which components are affected. This can help reviewers more easily identify PRs that affect areas of the codebase that they are responsible for overseeing. You can take this a step further and indicate the precise amount of changes that happen to each resource. For example, if you want to label based on the relative percentage of changes for specific resources.

label-resources-percent (1).png

gitStream can also help you quickly identify which PRs are awaiting additional changes from the author by labeling PRs that have unresolved requests for changes.

label-unresolved-threads.png

Check out the gitStream docs for more examples about automating GitHub PR labels. 

Code Review Auto-Assignment

Identifying and assigning PR reviewers can be a tedious assignment, particularly for large repos that have dozens or hundreds of contributors. GitHub has CODEOWNERS which allows you to define basic rules to assign PR reviewers, but we’ve covered in the past how it often fails to completely meet the needs of software development teams

gitStream also lets you assign reviewers based on the changed resources, and it can also notify specific people or teams based on a watch list of files and directories. But, where gitStream really shines is in how it provides a much deeper level of automatic code review assignment that accounts for details found in the PR. For example, you can have an automation that identifies the person with the highest level of code expertise for the PR and assign them for review

AssignCodeExperts(Light)-AutomationOnly.png

Alternatively, you can use gitStream to distribute code reviews across a team to increase horizontal code knowledge.

share-knowledge.png

You can also use gitStream to trigger reviews based on the results of third-party tools like SonarCloud. Or establish custom-review policies based on the source or destination branches. All of these features serve to help your team move away from one-size-fits-all code review policies that don’t meet the requirements of every PR.

Read the gitStream docs on review assignment to learn more.

Auto-Merge PRs

Some PRs have such a low risk that it might make sense to unblock them entirely and merge them without any further review. One common use case is automatically merging PRs from Dependabot to ensure that your dependencies are always up to date with the latest security fixes without requiring manual intervention.

There are many other situations where PRs might contain safe changes, such as documentation, tests, images and other minor assets, dependency version bumps, and more. gitStream allows you to set custom auto-merge policies for these situations and more to help you team reduce review noise for things that should bypass the standard review process.

approve-safe-changes.png

Branch, PR, and Security Policy Enforcement

It’s good practice to follow PR or branch naming conventions that are descriptive and support your team’s workflow automations. For example, gitStream can help you ensure that all PRs contain a reference to your team’s project management solution or to automatically link to a project tracking resource that is referenced in the PR title or branch name. You can also use gitStream to enforce semantic PR title requirements to improve the consistency of PR titles.

enforce-pr-title.png

Lastly, gitStream also lets you set custom rules to flag the use of deprecated APIs, functions, classes, or other software components and automatically request changes.

Intelligently Manage GitHub Actions with gitStream

gitStream offers a comprehensive solution to optimize your GitHub Actions workflows, including CI orchestration, PR label management, dynamic code review assignment, and PR auto-merge policies. gitStream makes it easy to reduce the amount of time you spend reviewing code so you can get back to productive work.

Build your first automation with gitStream in as little as two minutes.