Skip to content

Commit 09d068e

Browse files
authored
Update blossom-ci.yml
1 parent 7c7d629 commit 09d068e

File tree

1 file changed

+23
-38
lines changed

1 file changed

+23
-38
lines changed

.github/workflows/blossom-ci.yml

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022, NVIDIA CORPORATION.
1+
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,67 +26,52 @@ on:
2626
description: 'argument'
2727
required: false
2828
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:
45-
name: Authorize NVIDIA CI launch
46-
runs-on: blossom
47-
needs: [Check-Authorization]
29+
Authorization:
30+
name: Authorization
31+
runs-on: blossom
4832
outputs:
4933
args: ${{ env.args }}
50-
51-
if: contains('narendasan,', format('{0},', github.actor))
52-
34+
35+
# This job only runs for pull request comments
36+
if: |
37+
contains( 'narendasan,', format('{0},', github.actor)) &&
38+
github.event.comment.body == '/blossom-ci'
5339
steps:
54-
- name: Authorize Blossom launch
40+
- name: Check if comment is issued by authorized person
5541
run: blossom-ci
5642
env:
5743
OPERATION: 'AUTH'
5844
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5945
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
60-
6146

62-
Vulnerability-Scan:
47+
Vulnerability-scan:
6348
name: Vulnerability scan
64-
needs: [Authorize-Blossom]
49+
needs: [Authorization]
6550
runs-on: ubuntu-latest
6651
steps:
6752
- name: Checkout code
6853
uses: actions/checkout@v2
6954
with:
70-
repository: ${{ fromJson(needs.Authorize-Blossom.outputs.args).repo }}
71-
ref: ${{ fromJson(needs.Authorize-Blossom.outputs.args).ref }}
55+
repository: ${{ fromJson(needs.Authorization.outputs.args).repo }}
56+
ref: ${{ fromJson(needs.Authorization.outputs.args).ref }}
7257
lfs: 'true'
73-
58+
7459
- name: Run blossom action
7560
uses: NVIDIA/blossom-action@main
7661
env:
7762
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7863
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
7964
with:
80-
args1: ${{ fromJson(needs.Authorize-Blossom.outputs.args).args1 }}
81-
args2: ${{ fromJson(needs.Authorize-Blossom.outputs.args).args2 }}
82-
args3: ${{ fromJson(needs.Authorize-Blossom.outputs.args).args3 }}
65+
args1: ${{ fromJson(needs.Authorization.outputs.args).args1 }}
66+
args2: ${{ fromJson(needs.Authorization.outputs.args).args2 }}
67+
args3: ${{ fromJson(needs.Authorization.outputs.args).args3 }}
8368

84-
Launch-NVIDIA-CI:
85-
name: Start CI job on NVIDIA CI
86-
needs: [Vulnerability-Scan]
69+
Job-trigger:
70+
name: Start ci job
71+
needs: [Vulnerability-scan]
8772
runs-on: blossom
8873
steps:
89-
- name: Launch CI
74+
- name: Start ci job
9075
run: blossom-ci
9176
env:
9277
OPERATION: 'START-CI-JOB'
@@ -95,7 +80,6 @@ jobs:
9580

9681
Upload-Log:
9782
name: Upload log
98-
needs: [Launch-NVIDIA-CI]
9983
runs-on: blossom
10084
if : github.event_name == 'workflow_dispatch'
10185
steps:
@@ -105,3 +89,4 @@ jobs:
10589
OPERATION: 'POST-PROCESSING'
10690
CI_SERVER: ${{ secrets.CI_SERVER }}
10791
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+

0 commit comments

Comments
 (0)