-
Notifications
You must be signed in to change notification settings - Fork 1.8k
56 lines (50 loc) · 1.44 KB
/
ci-proto-checker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: CI PROTO Checker
on:
pull_request_target:
types:
- opened
- synchronize
branches:
- main
permissions:
issues: write
pull-requests: write
jobs:
proto-checker:
runs-on: ubuntu-latest
name: PROTO FILTER
if: >
!contains(github.event.pull_request.title, '(sync #') &&
!contains(github.event.pull_request.labels.*.name, 'sync') &&
(!startsWith(github.head_ref, github.base_ref) || !contains(github.head_ref, '-sync-'))
outputs:
output1: ${{ steps.proto-check-info.outputs.proto }}
steps:
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
proto:
- 'gensrc/proto/**'
- 'gensrc/thrift/**'
- name: PROTO CHECK INFO
id: proto-check-info
run: |
echo "proto=${{ steps.changes.outputs.proto }}" >> $GITHUB_OUTPUT
add-proto-review-label:
needs: proto-checker
runs-on: ubuntu-latest
name: ADD PROTO REVIEW LABEL
steps:
- name: add label
uses: actions-ecosystem/action-add-labels@v1
if: needs.proto-checker.outputs.output1 == 'true'
with:
github_token: ${{ secrets.PAT }}
labels: PROTO-REVIEW
- name: remove label
uses: actions-ecosystem/action-remove-labels@v1
if: needs.proto-checker.outputs.output1 != 'true'
with:
github_token: ${{ secrets.PAT }}
labels: PROTO-REVIEW