-
Notifications
You must be signed in to change notification settings - Fork 4.8k
92 lines (79 loc) · 2.58 KB
/
pull_request.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Pull Request
on:
pull_request:
branches: [master]
concurrency:
group: pr_${{ github.head_ref }}
cancel-in-progress: true
jobs:
pr_format:
name: Format
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Checkout
uses: actions/checkout@v3
- name: Detect changes in specific directories
id: detect_changes
uses: dorny/paths-filter@v2
with:
filters: |
react:
- 'react/**'
angular:
- 'angular/**'
node:
- 'node/**'
stage0:
- 'stage0/**'
stage1:
- 'stage1/**'
stage2:
- 'stage2/**'
- name: Add 'react' label
if: steps.detect_changes.outputs.react == 'true' && github.event.pull_request.head.repo.full_name == github.repository
uses: actions-ecosystem/action-add-labels@v1
with:
labels: |
react
- name: Add 'angular' label
if: steps.detect_changes.outputs.angular == 'true' && github.event.pull_request.head.repo.full_name == github.repository
uses: actions-ecosystem/action-add-labels@v1
with:
labels: |
angular
- name: Add 'node' label
if: steps.detect_changes.outputs.node == 'true' && github.event.pull_request.head.repo.full_name == github.repository
uses: actions-ecosystem/action-add-labels@v1
with:
labels: |
node
- name: Add 'stage#0' label
if: steps.detect_changes.outputs.stage0 == 'true' && github.event.pull_request.head.repo.full_name == github.repository
uses: actions-ecosystem/action-add-labels@v1
with:
labels: |
stage#0
- name: Add 'stage#1' label
if: steps.detect_changes.outputs.stage1 == 'true' && github.event.pull_request.head.repo.full_name == github.repository
uses: actions-ecosystem/action-add-labels@v1
with:
labels: |
stage#1
- name: Add 'stage#2' label
if: steps.detect_changes.outputs.stage2 == 'true' && github.event.pull_request.head.repo.full_name == github.repository
uses: actions-ecosystem/action-add-labels@v1
with:
labels: |
stage#2
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Format
run: |
npm run ci:format