File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module.exports = [
8
8
'actions/cache@v2' ,
9
9
'actions/checkout@v2' ,
10
10
'actions/github-script@0.9.0' ,
11
+ 'actions/github-script@v2.0.0' ,
11
12
'actions/github-script@v2' ,
12
13
'actions/github-script@v3' ,
13
14
'actions/labeler@v2' ,
@@ -25,6 +26,8 @@ module.exports = [
25
26
'pascalgn/automerge-action@135f0bdb927d9807b5446f7ca9ecc2c51de03c4a' ,
26
27
'peter-evans/create-issue-from-file@v2' ,
27
28
'peter-evans/create-pull-request@v2' ,
29
+ 'rachmari/actions-add-new-issue-to-column@v1.1.1' ,
30
+ 'rachmari/labeler@v1.0.4' ,
28
31
'repo-sync/github-sync@v2' ,
29
32
'repo-sync/pull-request@v2' ,
30
33
'rtCamp/action-slack-notify@master' ,
Original file line number Diff line number Diff line change @@ -19,17 +19,23 @@ function actionsUsedInWorkflow (workflow) {
19
19
. map ( key => get ( workflow , key ) )
20
20
}
21
21
22
+ const allUsedActions = chain ( workflows )
23
+ . map ( actionsUsedInWorkflow )
24
+ . flatten ( )
25
+ . uniq ( )
26
+ . sort ( )
27
+ . value ( )
28
+
22
29
describe ( 'GitHub Actions workflows' , ( ) => {
23
- test ( 'only use allowed actions from ./github/allow-actions.json' , async ( ) => {
24
- const allUsedActions = chain ( workflows )
25
- . map ( actionsUsedInWorkflow )
26
- . flatten ( )
27
- . uniq ( )
28
- . sort ( )
29
- . value ( )
30
+ test ( 'all used actions are allowed in .github/allowed-actions.js' , ( ) => {
31
+ expect ( allUsedActions . length ) . toBeGreaterThan ( 0 )
32
+ const unusedActions = difference ( allowedActions , allUsedActions )
33
+ expect ( unusedActions ) . toEqual ( [ ] )
34
+ } )
30
35
36
+ test ( 'all allowed actions by .github/allowed-actions.js are used by at least one workflow' , ( ) => {
31
37
expect ( allowedActions . length ) . toBeGreaterThan ( 0 )
32
- expect ( allUsedActions . length ) . toBeGreaterThan ( 0 )
33
- expect ( difference ( allowedActions , allUsedActions ) ) . toEqual ( [ ] )
38
+ const disallowedActions = difference ( allUsedActions , allowedActions )
39
+ expect ( disallowedActions ) . toEqual ( [ ] )
34
40
} )
35
41
} )
You can’t perform that action at this time.
0 commit comments