File tree 2 files changed +15
-6
lines changed
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -11,22 +11,24 @@ const schema = Joi.object({
11
11
. required ( ) ,
12
12
} ) . required ( )
13
13
14
- module . exports = class GithubActions extends BaseSvgScrapingService {
14
+ const keywords = [ 'action' , 'actions' ]
15
+
16
+ module . exports = class GithubWorkflowStatus extends BaseSvgScrapingService {
15
17
static get category ( ) {
16
18
return 'build'
17
19
}
18
20
19
21
static get route ( ) {
20
22
return {
21
- base : 'github/actions ' ,
23
+ base : 'github/workflow/status ' ,
22
24
pattern : ':user/:repo/:workflow/:branch*' ,
23
25
}
24
26
}
25
27
26
28
static get examples ( ) {
27
29
return [
28
30
{
29
- title : 'GitHub Actions ' ,
31
+ title : 'GitHub Workflow Status ' ,
30
32
pattern : ':user/:repo/:workflow' ,
31
33
namedParams : {
32
34
user : 'actions' ,
@@ -37,9 +39,10 @@ module.exports = class GithubActions extends BaseSvgScrapingService {
37
39
status : 'passing' ,
38
40
} ) ,
39
41
documentation,
42
+ keywords,
40
43
} ,
41
44
{
42
- title : 'GitHub Actions (branch)' ,
45
+ title : 'GitHub Workflow Status (branch)' ,
43
46
pattern : ':user/:repo/:workflow/:branch' ,
44
47
namedParams : {
45
48
user : 'actions' ,
@@ -51,6 +54,7 @@ module.exports = class GithubActions extends BaseSvgScrapingService {
51
54
status : 'passing' ,
52
55
} ) ,
53
56
documentation,
57
+ keywords,
54
58
} ,
55
59
]
56
60
}
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
+ const Joi = require ( '@hapi/joi' )
3
4
const { isBuildStatus } = require ( '../build-status' )
4
5
const t = ( module . exports = require ( '../tester' ) . createServiceTester ( ) )
5
6
7
+ const isWorkflowStatus = Joi . alternatives ( )
8
+ . try ( isBuildStatus , Joi . equal ( 'no status' ) )
9
+ . required ( )
10
+
6
11
t . create ( 'nonexistent repo' )
7
12
. get ( '/badges/shields-fakeness/fake.json' )
8
13
. expectBadge ( {
@@ -21,12 +26,12 @@ t.create('valid workflow')
21
26
. get ( '/actions/toolkit/Main%20workflow.json' )
22
27
. expectBadge ( {
23
28
label : 'build' ,
24
- message : isBuildStatus ,
29
+ message : isWorkflowStatus ,
25
30
} )
26
31
27
32
t . create ( 'valid workflow (branch)' )
28
33
. get ( '/actions/toolkit/Main%20workflow/master.json' )
29
34
. expectBadge ( {
30
35
label : 'build' ,
31
- message : isBuildStatus ,
36
+ message : isWorkflowStatus ,
32
37
} )
You can’t perform that action at this time.
0 commit comments