|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -name: Execute notebooks found in a pull request and create links to their output files |
| 15 | +name: 'Run Vertex AI Notebook' |
16 | 16 |
|
17 | 17 | on: |
18 | 18 | pull_request: |
19 | | - types: [ labeled ] |
| 19 | + types: |
| 20 | + - 'labeled' |
20 | 21 | branches: |
21 | | - - main |
| 22 | + - 'main' |
22 | 23 |
|
23 | 24 | permissions: |
24 | 25 | pull-requests: 'write' |
25 | 26 | issues: 'write' |
26 | | - contents: write |
| 27 | + contents: 'write' |
27 | 28 | id-token: 'write' |
28 | 29 |
|
29 | 30 | env: |
30 | | - GCS_SOURCE: mybucket/ghnbr/source # TODO: Update to a bucket with proper ACLs |
31 | | - GCS_OUTPUT: mybucket/ghnbr/output # TODO: Update to a bucket with proper ACLs |
| 31 | + GCS_SOURCE: 'mybucket/ghnbr/source' # TODO: Update to a bucket with proper ACLs |
| 32 | + GCS_OUTPUT: 'mybucket/ghnbr/output' # TODO: Update to a bucket with proper ACLs |
32 | 33 |
|
33 | 34 | jobs: |
34 | 35 |
|
35 | 36 | # JOB to run change detection and build the allowlist |
36 | 37 | changes: |
37 | | - if: ${{ github.event.label.name == 'notebook-review' }} |
38 | | - runs-on: ubuntu-latest |
| 38 | + if: |- |
| 39 | + ${{ github.event.label.name == 'notebook-review' }} |
| 40 | + runs-on: 'ubuntu-latest' |
39 | 41 | # Set job outputs to values from filter step |
40 | 42 | outputs: |
41 | | - notebooks: ${{ steps.filter.outputs.notebooks }} |
42 | | - notebooks_files: ${{ steps.filter.outputs.notebooks_files }} |
| 43 | + notebooks: '${{ steps.filter.outputs.notebooks }}' |
| 44 | + notebooks_files: '${{ steps.filter.outputs.notebooks_files }}' |
43 | 45 | steps: |
44 | | - # For pull requests it's not necessary to checkout the code |
45 | | - - uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721 |
46 | | - id: filter |
47 | | - with: |
48 | | - list-files: shell |
49 | | - filters: | |
50 | | - notebooks: |
51 | | - - 'somedir/**.ipynb' |
| 46 | + # For pull requests it's not necessary to checkout the code |
| 47 | + - uses: 'dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721' |
| 48 | + id: 'filter' |
| 49 | + with: |
| 50 | + list-files: 'shell' |
| 51 | + filters: |- |
| 52 | + notebooks: |
| 53 | + - 'somedir/**.ipynb' |
52 | 54 |
|
53 | 55 | # JOB to initiate the notebook review process |
54 | 56 | notebook-review: |
55 | 57 | name: 'Notebook Review' |
56 | | - needs: changes |
57 | | - if: ${{ needs.changes.outputs.notebooks == 'true' }} |
58 | | - runs-on: ubuntu-latest |
| 58 | + needs: 'changes' |
| 59 | + if: |- |
| 60 | + ${{ needs.changes.outputs.notebooks == 'true' }} |
| 61 | + runs-on: 'ubuntu-latest' |
59 | 62 |
|
60 | 63 | steps: |
61 | | - - id: 'checkout' |
62 | | - uses: 'actions/checkout@v4' |
63 | | - # Configure Workload Identity Federation and generate an access token. |
64 | | - - id: 'auth' |
65 | | - name: 'Authenticate to Google Cloud' |
66 | | - uses: 'google-github-actions/auth@b258a9f230b36c9fa86dfaa43d1906bd76399edb' |
67 | | - with: |
68 | | - workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider' |
69 | | - service_account: 'my-service-account@my-project.iam.gserviceaccount.com' |
| 64 | + - id: 'checkout' |
| 65 | + uses: 'actions/checkout@v4' |
70 | 66 |
|
71 | | - # Alternative option - authentication via credentials json |
72 | | - # - id: 'auth' |
73 | | - # uses: 'google-github-actions/auth@b258a9f230b36c9fa86dfaa43d1906bd76399edb' |
74 | | - # with: |
75 | | - # credentials_json: '${{ secrets.GCP_CREDENTIALS }}' |
| 67 | + # Configure Workload Identity Federation and generate an access token. |
| 68 | + - id: 'auth' |
| 69 | + name: 'Authenticate to Google Cloud' |
| 70 | + uses: 'google-github-actions/auth@b258a9f230b36c9fa86dfaa43d1906bd76399edb' |
| 71 | + with: |
| 72 | + workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider' |
| 73 | + service_account: 'my-service-account@my-project.iam.gserviceaccount.com' |
76 | 74 |
|
77 | | - - id: notebook-review |
78 | | - uses: 'google-github-actions/run-vertexai-notebook@v0' |
79 | | - with: |
80 | | - gcs_source_bucket: '${{ env.GCS_SOURCE }}' |
81 | | - gcs_output_bucket: '${{ env.GCS_OUTPUT }}' |
82 | | - allowlist: '${{ needs.changes.outputs.notebooks_files }}' |
| 75 | + # Alternative option - authentication via credentials json |
| 76 | + # - id: 'auth' |
| 77 | + # uses: 'google-github-actions/auth@b258a9f230b36c9fa86dfaa43d1906bd76399edb' |
| 78 | + # with: |
| 79 | + # credentials_json: '${{ secrets.GCP_CREDENTIALS }}' |
| 80 | + |
| 81 | + - id: 'notebook-review' |
| 82 | + uses: 'google-github-actions/run-vertexai-notebook@v0' |
| 83 | + with: |
| 84 | + gcs_source_bucket: '${{ env.GCS_SOURCE }}' |
| 85 | + gcs_output_bucket: '${{ env.GCS_OUTPUT }}' |
| 86 | + allowlist: '${{ needs.changes.outputs.notebooks_files }}' |
0 commit comments