@@ -5,18 +5,6 @@ const { lint, load } = require('@commitlint/core')
5
5
const config = require ( './config' )
6
6
const format = require ( './format' )
7
7
8
- // Globals
9
- const baseStatus = {
10
- context : 'commitlint-bot' ,
11
- // commitlint rules reference URL
12
- target_url : 'http://npm.im/@commitlint/config-angular#problems'
13
- }
14
- const pendingStatus = {
15
- ...baseStatus ,
16
- state : 'pending' ,
17
- description : 'Running commitlint for this PR'
18
- }
19
-
20
8
/**
21
9
* Runs commitlint over all commits of the pull request and sets an appropriate
22
10
* status check
@@ -29,11 +17,17 @@ const commitlint = async ({ github, payload }) => {
29
17
const statusInfo = {
30
18
sha : payload . pull_request . head . sha ,
31
19
repo : name ,
32
- owner : owner . login
20
+ owner : owner . login ,
21
+ context : 'commitlint-bot' ,
22
+ target_url : 'http://npm.im/@commitlint/config-angular#problems'
33
23
}
34
24
35
25
// Pending
36
- github . repos . createStatus ( { ...statusInfo , ...pendingStatus } )
26
+ github . repos . createStatus ( {
27
+ ...statusInfo ,
28
+ state : 'pending' ,
29
+ description : 'Waiting for the status to be reported'
30
+ } )
37
31
38
32
// Paginate all PR commits
39
33
github . paginate (
@@ -56,7 +50,6 @@ const commitlint = async ({ github, payload }) => {
56
50
// Final report
57
51
github . repos . createStatus ( {
58
52
...statusInfo ,
59
- ...baseStatus ,
60
53
state : report . valid ? 'success' : 'error' ,
61
54
description : format ( report )
62
55
} )
0 commit comments