File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Pull request code checks
2
+
3
+ When a new pull request is opened against the main branch, it is a good idea to run some checks on the code to make sure
4
+ that it is up to the standards of the project.
5
+ You can run it on every push, but it is better to run it only when a pull request is approved, to avoid reaching the
6
+ limits of the Github Actions free tier.
7
+
8
+ Take a look at the following example:
9
+
10
+ ``` yaml
11
+
12
+ name : pull-request-code-checks
13
+
14
+ on :
15
+ # (1) Run the workflow only when a pull request is:
16
+ # - opened against the main branch
17
+ # - and a review is submitted
18
+ pull_request_review :
19
+ branches :
20
+ - main
21
+ types : [ submitted ]
22
+
23
+ jobs :
24
+ build :
25
+ name : Build
26
+ runs-on : ubuntu-latest
27
+
28
+ steps :
29
+ - name : Checkout
30
+ uses : actions/checkout@v4
31
+
32
+ - name : Setup
33
+ uses : ./.github/actions/setup
34
+
35
+ - name : Build
36
+ run : yarn build
37
+
38
+ lint :
39
+ name : Lint
40
+ runs-on : ubuntu-latest
41
+
42
+ steps :
43
+ - name : Checkout
44
+ uses : actions/checkout@v4
45
+
46
+ - name : Setup
47
+ uses : ./.github/actions/setup
48
+
49
+ - name : Lint
50
+ run : yarn lint
51
+
52
+ ```
53
+
You can’t perform that action at this time.
0 commit comments