Skip to content

Commit 9b9b006

Browse files
CI: Make auto-triage more robust (#53)
- Add a global "triage" workflow instead of only changelogs. - Add a check for updated unit tests.
1 parent dbeb0f3 commit 9b9b006

File tree

2 files changed

+67
-23
lines changed

2 files changed

+67
-23
lines changed

.github/workflows/changelog.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/triage.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Triage
2+
on:
3+
pull_request:
4+
types:
5+
- "opened"
6+
- "reopened"
7+
- "synchronize"
8+
- "labeled"
9+
- "unlabeled"
10+
11+
jobs:
12+
changelog_check:
13+
runs-on: ubuntu-latest
14+
name: Check for changelog updates
15+
steps:
16+
- name: "Check if the source directory was changed"
17+
uses: dorny/paths-filter@v3
18+
id: changes
19+
with:
20+
filters: |
21+
src:
22+
- 'src/**'
23+
24+
- name: "Check for changelog updates"
25+
if: steps.changes.outputs.src == 'true'
26+
uses: brettcannon/check-for-changed-files@v1
27+
with:
28+
file-pattern: |
29+
CHANGELOG.md
30+
skip-label: "skip changelog"
31+
failure-message: "Missing a CHANGELOG.md update; please add one or apply the ${skip-label} label to the pull request"
32+
33+
tests_check:
34+
runs-on: ubuntu-latest
35+
name: Check for updated tests
36+
steps:
37+
- name: "Check if the source directory was changed"
38+
uses: dorny/paths-filter@v3
39+
id: changes
40+
with:
41+
filters: |
42+
src:
43+
- 'src/**'
44+
45+
- name: "Check for test updates"
46+
if: steps.changes.outputs.src == 'true'
47+
uses: brettcannon/check-for-changed-files@v1
48+
with:
49+
file-pattern: |
50+
tests/*
51+
skip-label: "skip tests"
52+
failure-message: "Missing unit tests; please add some or apply the ${skip-label} label to the pull request"
53+
54+
all_green:
55+
runs-on: ubuntu-latest
56+
name: PR has no missing information
57+
if: always()
58+
59+
needs:
60+
- changelog_check
61+
- tests_check
62+
63+
steps:
64+
- name: Check whether jobs passed
65+
uses: re-actors/alls-green@release/v1
66+
with:
67+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)