|
15 | 15 | type: string |
16 | 16 |
|
17 | 17 | jobs: |
18 | | - validate-access: |
19 | | - runs-on: ubuntu-latest |
20 | | - outputs: |
21 | | - authorized: ${{ steps.check.outputs.authorized }} |
22 | | - steps: |
23 | | - - name: Check User Authorization |
24 | | - id: check |
25 | | - run: | |
26 | | - # Allow NVIDIA employees and approved bots |
27 | | - allowed_actors=( |
28 | | - "nvidia-employee1" |
29 | | - "nvidia-employee2" |
30 | | - "copy-pr-bot" # Allow the copy PR bot |
31 | | - "nvidia-bot" # Allow other NVIDIA bots |
32 | | - ) |
33 | | -
|
34 | | - # Block external contributors |
35 | | - blocked_patterns=( |
36 | | - "external-" |
37 | | - "contributor-" |
38 | | - "guest-" |
39 | | - ) |
40 | | -
|
41 | | - actor="${{ github.actor }}" |
42 | | -
|
43 | | - # Check if actor is explicitly allowed |
44 | | - for allowed in "${allowed_actors[@]}"; do |
45 | | - if [[ "$actor" == "$allowed" ]]; then |
46 | | - echo "authorized=true" >> $GITHUB_OUTPUT |
47 | | - echo "✅ Authorized user: $actor" |
48 | | - exit 0 |
49 | | - fi |
50 | | - done |
51 | | -
|
52 | | - # Check if actor matches blocked patterns |
53 | | - for pattern in "${blocked_patterns[@]}"; do |
54 | | - if [[ "$actor" == *"$pattern"* ]]; then |
55 | | - echo "❌ Blocked user pattern: $actor" |
56 | | - echo "authorized=false" >> $GITHUB_OUTPUT |
57 | | - exit 1 |
58 | | - fi |
59 | | - done |
60 | | -
|
61 | | - # Default: block unknown users |
62 | | - echo "❌ Unauthorized user: $actor" |
63 | | - echo "authorized=false" >> $GITHUB_OUTPUT |
64 | | - exit 1 |
65 | | -
|
66 | | - trigger-deploy-tests: |
67 | | - runs-on: ubuntu-latest |
68 | | - needs: validate-access |
69 | | - if: needs.validate-access.outputs.authorized == 'true' |
70 | | - environment: protected-deploy # manual approval before triggering |
71 | | - steps: |
72 | | - - name: Call Secure Deploy Workflow |
73 | | - uses: ./.github/workflows/container-validation-backends.yml |
74 | | - with: |
75 | | - run_deploy_operator: ${{ github.event.inputs.run_deploy_operator }} |
| 18 | + call-container-validation: |
| 19 | + uses: ./.github/workflows/container-validation-backends.yml |
| 20 | + with: |
| 21 | + run_deploy_operator: ${{ github.event.inputs.run_deploy_operator }} |
| 22 | + target_branch: ${{ github.event.inputs.target_branch }} |
| 23 | + environment: protected-deploy # manual approval before triggering |
0 commit comments