Skip to content

Commit d61db5e

Browse files
authored
Update linters (#37)
1 parent cdcf572 commit d61db5e

File tree

2 files changed

+49
-41
lines changed

2 files changed

+49
-41
lines changed

examples/.github/workflows/notebook-review.yml

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,71 +12,75 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Execute notebooks found in a pull request and create links to their output files
15+
name: 'Run Vertex AI Notebook'
1616

1717
on:
1818
pull_request:
19-
types: [ labeled ]
19+
types:
20+
- 'labeled'
2021
branches:
21-
- main
22+
- 'main'
2223

2324
permissions:
2425
pull-requests: 'write'
2526
issues: 'write'
26-
contents: write
27+
contents: 'write'
2728
id-token: 'write'
2829

2930
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
3233

3334
jobs:
3435

3536
# JOB to run change detection and build the allowlist
3637
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'
3941
# Set job outputs to values from filter step
4042
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 }}'
4345
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'
5254
5355
# JOB to initiate the notebook review process
5456
notebook-review:
5557
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'
5962

6063
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'
7066

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'
7674

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 }}'

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"build": "echo \"No build required for composite action\"",
77
"test": "echo \"Error: no test specified\" && exit 1"
88
},
9+
"engines": {
10+
"node": "20.x",
11+
"npm": "10.x"
12+
},
913
"repository": {
1014
"type": "git",
1115
"url": "git+https://github.com/google-github-actions/run-vertexai-notebook.git"

0 commit comments

Comments
 (0)