|
| 1 | +# -*- mode: yaml -*- |
| 2 | +# This example configuration provides basic automations to get started with gitStream. |
| 3 | +# View the gitStream quickstart for more examples: https://docs.gitstream.cm/examples/ |
| 4 | +manifest: |
| 5 | + version: 1.0 |
| 6 | + |
| 7 | + |
| 8 | +automations: |
| 9 | + # Use LinearB's AI service to review the changes |
| 10 | + linearb_ai_review: |
| 11 | + if: |
| 12 | + - {{ not pr.draft }} |
| 13 | + - {{ pr.author | match(list=['github-actions', 'dependabot', '[bot]']) | nope }} |
| 14 | + run: |
| 15 | + - action: code-review@v1 |
| 16 | + |
| 17 | + # Use LinearB's AI service to add a description to the PR |
| 18 | + linearb_ai_description: |
| 19 | + if: |
| 20 | + - {{ not pr.draft }} |
| 21 | + - {{ pr.author | match(list=['github-actions', 'dependabot', '[bot]']) | nope }} |
| 22 | + run: |
| 23 | + - action: describe-changes@v1 |
| 24 | + args: |
| 25 | + concat_mode: append |
| 26 | + |
| 27 | + # Add a label indicating how long it will take to review the PR. |
| 28 | + estimated_time_to_review: |
| 29 | + if: |
| 30 | + - true |
| 31 | + run: |
| 32 | + - action: add-label@v1 |
| 33 | + args: |
| 34 | + label: "{{ calc.etr }} min review" |
| 35 | + color: {{ colors.red if (calc.etr >= 20) else ( colors.yellow if (calc.etr >= 5) else colors.green ) }} |
| 36 | + # Inform PR authors when they fail to reference Jira tickets in the PR title or description. |
| 37 | + label_missing_jira_info: |
| 38 | + if: |
| 39 | + - {{ not (has.jira_ticket_in_title or has.jira_ticket_in_desc) }} |
| 40 | + run: |
| 41 | + - action: add-label@v1 |
| 42 | + args: |
| 43 | + label: "missing-jira" |
| 44 | + color: {{ colors.red }} |
| 45 | + - action: add-comment@v1 |
| 46 | + args: |
| 47 | + comment: | |
| 48 | + This PR is missing a Jira ticket reference in the title or description. |
| 49 | + Please add a Jira ticket reference to the title or description of this PR. |
| 50 | + # Post a comment that lists the best experts for the files that were modified. |
| 51 | + explain_code_experts: |
| 52 | + if: |
| 53 | + - true |
| 54 | + run: |
| 55 | + - action: explain-code-experts@v1 |
| 56 | + args: |
| 57 | + gt: 10 |
| 58 | + |
| 59 | + |
| 60 | +# +----------------------------------------------------------------------------+ |
| 61 | +# | Custom Expressions | |
| 62 | +# | https://docs.gitstream.cm/how-it-works/#custom-expressions | |
| 63 | +# +----------------------------------------------------------------------------+ |
| 64 | + |
| 65 | +calc: |
| 66 | + etr: {{ branch | estimatedReviewTime }} |
| 67 | + |
| 68 | +has: |
| 69 | + jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }} |
| 70 | + jira_ticket_in_desc: {{ pr.description | includes(regex=r/atlassian.net\/browse\/\w{1,}-\d{3,4}/) }} |
| 71 | + |
| 72 | +colors: |
| 73 | + red: 'b60205' |
| 74 | + yellow: 'fbca04' |
| 75 | + green: '0e8a16' |
0 commit comments