Label PRs by Language
Automatically detect which programming languages are contained in PRs and automatically label the PRs appropriately.
Configuration Description
Conditions (all must be true):
- A PR is created or updated.
Automation Actions:
- Label the PR for each programming language that is included.
Label PRs by Language
# -*- mode: yaml -*-
manifest:
version: 1.0
automations:
{% for item in labels %}
label_{{ item.name }}_pr:
if:
- {{ files | match(regex=item.resources) | some }}
run:
- action: add-label@v1
args:
label: '{{ item.name }}'
{% endfor %}
labels:
- name: Java
resources: r/.java$/
- name: Rust
resources: r/.rs$/
- name: HTML
resources: r/.html$/
- name: JavaScript
resources: r/.js$/
- name: Python
resources: r/.py$/
- name: Golang
resources: r/.go$/
- name: Ruby
resources: r/.rb$/
- name: CSS
resources: r/.css/
Additional Resources
gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.
Learn More about how gitStream Works.
Related Automations:
- Estimate the amount of time it would require someone to complete a PR review.
- Flag missing Jira ticket information
- Label PRs that delete files.
- Label PRs that lack tests
- Provide information about what percent of a PR is new code.
- Request PR authors to provide screenshots in relevant PRs.
More Automations can be found on the Automation Library and Integrations pages.