Skip to content

Instantly share code, notes, and snippets.

@marcelosousa
Created October 27, 2022 15:49
Show Gist options
  • Save marcelosousa/88dc36565b83933fa893d85091e0fd6a to your computer and use it in GitHub Desktop.
Save marcelosousa/88dc36565b83933fa893d85091e0fd6a to your computer and use it in GitHub Desktop.
Automate pull requeres in 1 minute
api-version: reviewpad.com/v3.x
labels:
small:
color: "#294b69"
medium:
color: "#a8c3f7"
large:
color: "#8a2138"
workflows:
- name: add-label-with-size
always-run: true
if:
- rule: $size() <= 30
extra-actions:
- '$addLabel("small")'
- rule: $size() > 30 && $size() <= 100
extra-actions:
- '$addLabel("medium")'
- rule: $size() > 100
extra-actions:
- '$addLabel("large")'
- name: lint-commits
always-run: true
if:
- rule: '!$hasLinearHistory()'
extra-actions:
- '$warn($sprintf("The pull request it outdated with the base @%v", $base()))'
- '$fail("Pull request is outdated")'
- rule: 'true'
extra-actions:
- '$commitLint()'
- '$titleLint()'
- name: check-for-linked-issued
always-run: true
if:
- '!$hasLinkedIssues()'
then:
- '$info("This pull request does not have a linked issue")'
- name: empty-description
always-run: true
if:
- $description() == ""
then:
- '$warn("The description is empty. Please add more information!")'
- '$fail("Empty description")'
- name: first-time-contributor
always-run: true
if:
- '$pullRequestCountBy($author(), "all") == 1'
then:
- '$commentOnce($sprintf("Welcome @%v! Thank you so much for your first pull request!", [$author()]))'
{
"name": "Reviewpad Starter Workflow",
"description": "Reviewpad starter workflow.",
"iconName": "reviewpad-icon"
}
name: Reviewpad
on: pull_request_target
jobs:
reviewpad_job:
runs-on: ubuntu-latest
name: Reviewpad
steps:
- name: Reviewpad
uses: reviewpad/action@v3.x
with:
# Uses a default Reviewpad configuration file to get your started.
# For customization and documentation, see https://github.com/reviewpad/action
file_url: https://github.com/reviewpad/.github/blob/main/reviewpad-models/common.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment