25
25
args :
26
26
description : ' argument'
27
27
required : false
28
- jobs :
29
- Authorization :
30
- name : Authorization
28
+ jobs :
29
+ Check-Authorization :
30
+ runs-on : ubuntu-latest
31
+ outputs :
32
+ AUTHORIZED : ${{ steps.check-authorization.outputs.authorized }}
33
+ steps :
34
+ - id : check-authorization
35
+ name : Check if commentor is allowed to launch NVIDIA CI
36
+ env :
37
+ AUTHORIZED_USERS : ${{ secrets.AUTHORIZED_USERS }}
38
+ if : |
39
+ contains(${{env.AUTHORIZED_USERS }}, format('{0},', github.actor)) &&
40
+ github.event.comment.body == '/nvidia-ci'
41
+ run : echo "::set-output name=authorized=true"
42
+
43
+
44
+ Authorize-Blossom :
31
45
runs-on : blossom
46
+ needs : [Check-Authorization]
32
47
outputs :
33
48
args : ${{ env.args }}
34
49
35
50
steps :
36
- - name : Check if comment is issued by authorized person
51
+ - name : Authorize Blossom launch
37
52
env :
38
53
OPERATION : ' AUTH'
39
- AUTHORIZED_USERS : ${{ secrets.AUTHORIZED_USERS }}
40
54
REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41
55
REPO_KEY_DATA : ${{ secrets.BLOSSOM_KEY }}
42
- if : |
43
- contains( ${{ env.AUTHORIZED_USERS }}, format('{0},', github.actor)) &&
44
- github.event.comment.body == '/nvidia-ci'
56
+ if : needs.Check-Authorization.outputs.authorized == 'true'
45
57
run : blossom-ci
46
58
47
- Vulnerability-scan :
59
+ Vulnerability-Scan :
48
60
name : Vulnerability scan
49
- needs : [Authorization ]
61
+ needs : [Authorize-Blossom ]
50
62
runs-on : ubuntu-latest
51
63
steps :
52
64
- name : Checkout code
@@ -66,12 +78,12 @@ jobs:
66
78
args2 : ${{ fromJson(needs.Authorization.outputs.args).args2 }}
67
79
args3 : ${{ fromJson(needs.Authorization.outputs.args).args3 }}
68
80
69
- Job-trigger :
70
- name : Start ci job
71
- needs : [Vulnerability-scan ]
81
+ Launch-NVIDIA-CI :
82
+ name : Start ci job on Blossom
83
+ needs : [Vulnerability-Scan ]
72
84
runs-on : blossom
73
85
steps :
74
- - name : Start ci job
86
+ - name : Launch CI
75
87
run : blossom-ci
76
88
env :
77
89
OPERATION : ' START-CI-JOB'
0 commit comments