Skip to content

Commit 27102d2

Browse files
graysideiennae
andauthored
ci: Update workflows for ai/ml/data to use labeled on pull_request trigger (#3753)
Co-authored-by: Jennifer Davis <[email protected]>
1 parent 917da65 commit 27102d2

8 files changed

+55
-63
lines changed

.github/workflows/ai-platform-snippets.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ on:
2121
- 'ai-platform/snippets/**'
2222
- '.github/workflows/ai-platform-snippets.yaml'
2323
pull_request:
24-
paths:
25-
- 'ai-platform/snippets/**'
26-
- '.github/workflows/ai-platform-snippets.yaml'
27-
pull_request_target:
28-
types: [labeled]
24+
types:
25+
- opened
26+
- reopened
27+
- synchronize
28+
- labeled
2929
paths:
3030
- 'ai-platform/snippets/**'
3131
- '.github/workflows/ai-platform-snippets.yaml'
3232
schedule:
33-
- cron: '0 0 * * 0'
33+
- cron: '0 0 * * 0'
3434
jobs:
3535
test:
3636
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
@@ -67,8 +67,7 @@ jobs:
6767
with:
6868
path: ${{ steps.npm-cache-dir.outputs.dir }}
6969
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
70-
restore-keys: |
71-
${{ runner.os }}-node-
70+
restore-keys: "${{ runner.os }}-node- \n"
7271
- name: set env vars for scheduled run
7372
if: github.event.action == 'schedule'
7473
run: |

.github/workflows/datacatalog-cloud-client.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@ on:
2222
- '.github/workflows/datacatalog-cloud-client.yaml'
2323
- '.github/workflows/test.yaml'
2424
pull_request:
25-
paths:
26-
- 'datacatalog/cloud-client/**'
27-
- '.github/workflows/datacatalog-cloud-client.yaml'
28-
- '.github/workflows/test.yaml'
29-
pull_request_target:
30-
types: [labeled]
25+
types:
26+
- opened
27+
- reopened
28+
- synchronize
29+
- labeled
3130
paths:
3231
- 'datacatalog/cloud-client/**'
3332
- '.github/workflows/datacatalog-cloud-client.yaml'
3433
- '.github/workflows/test.yaml'
3534
schedule:
36-
- cron: '0 0 * * 0'
35+
- cron: '0 0 * * 0'
3736
jobs:
3837
test:
3938
permissions:

.github/workflows/datacatalog-quickstart.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@ on:
2222
- '.github/workflows/datacatalog-quickstart.yaml'
2323
- '.github/workflows/test.yaml'
2424
pull_request:
25-
paths:
26-
- 'datacatalog/quickstart/**'
27-
- '.github/workflows/datacatalog-quickstart.yaml'
28-
- '.github/workflows/test.yaml'
29-
pull_request_target:
30-
types: [labeled]
25+
types:
26+
- opened
27+
- reopened
28+
- synchronize
29+
- labeled
3130
paths:
3231
- 'datacatalog/quickstart/**'
3332
- '.github/workflows/datacatalog-quickstart.yaml'
3433
- '.github/workflows/test.yaml'
3534
schedule:
36-
- cron: '0 0 * * 0'
35+
- cron: '0 0 * * 0'
3736
jobs:
3837
test:
3938
permissions:

.github/workflows/datacatalog-snippets.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@ on:
2222
- '.github/workflows/datacatalog-snippets.yaml'
2323
- '.github/workflows/test.yaml'
2424
pull_request:
25-
paths:
26-
- 'datacatalog/snippets/**'
27-
- '.github/workflows/datacatalog-snippets.yaml'
28-
- '.github/workflows/test.yaml'
29-
pull_request_target:
30-
types: [labeled]
25+
types:
26+
- opened
27+
- reopened
28+
- synchronize
29+
- labeled
3130
paths:
3231
- 'datacatalog/snippets/**'
3332
- '.github/workflows/datacatalog-snippets.yaml'
3433
- '.github/workflows/test.yaml'
3534
schedule:
36-
- cron: '0 0 * * 0'
35+
- cron: '0 0 * * 0'
3736
jobs:
3837
test:
3938
permissions:

.github/workflows/datalabeling.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@ on:
2222
- '.github/workflows/datalabeling.yaml'
2323
- '.github/workflows/test.yaml'
2424
pull_request:
25-
paths:
26-
- 'datalabeling/**'
27-
- '.github/workflows/datalabeling.yaml'
28-
- '.github/workflows/test.yaml'
29-
pull_request_target:
30-
types: [labeled]
25+
types:
26+
- opened
27+
- reopened
28+
- synchronize
29+
- labeled
3130
paths:
3231
- 'datalabeling/**'
3332
- '.github/workflows/datalabeling.yaml'
3433
- '.github/workflows/test.yaml'
3534
schedule:
36-
- cron: '0 0 * * 0'
35+
- cron: '0 0 * * 0'
3736
jobs:
3837
test:
3938
permissions:

.github/workflows/dataproc.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@ on:
2222
- '.github/workflows/dataproc.yaml'
2323
- '.github/workflows/test.yaml'
2424
pull_request:
25-
paths:
26-
- 'dataproc/**'
27-
- '.github/workflows/dataproc.yaml'
28-
- '.github/workflows/test.yaml'
29-
pull_request_target:
30-
types: [labeled]
25+
types:
26+
- opened
27+
- reopened
28+
- synchronize
29+
- labeled
3130
paths:
3231
- 'dataproc/**'
3332
- '.github/workflows/dataproc.yaml'
3433
- '.github/workflows/test.yaml'
3534
schedule:
36-
- cron: '0 0 * * 0'
35+
- cron: '0 0 * * 0'
3736
jobs:
3837
test:
3938
permissions:

.github/workflows/dlp.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@ on:
2222
- '.github/workflows/dlp.yaml'
2323
- '.github/workflows/test.yaml'
2424
pull_request:
25-
paths:
26-
- 'dlp/**'
27-
- '.github/workflows/dlp.yaml'
28-
- '.github/workflows/test.yaml'
29-
pull_request_target:
30-
types: [labeled]
25+
types:
26+
- opened
27+
- reopened
28+
- synchronize
29+
- labeled
3130
paths:
3231
- 'dlp/**'
3332
- '.github/workflows/dlp.yaml'
3433
- '.github/workflows/test.yaml'
3534
schedule:
36-
- cron: '0 0 * * 0'
35+
- cron: '0 0 * * 0'
3736
jobs:
3837
test:
3938
permissions:

.github/workflows/generative-ai-snippets.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ on:
2121
- 'generative-ai/snippets/**'
2222
- '.github/workflows/generative-ai-snippets.yaml'
2323
pull_request:
24-
paths:
25-
- 'generative-ai/snippets/**'
26-
- '.github/workflows/generative-ai-snippets.yaml'
27-
pull_request_target:
28-
types: [labeled]
24+
types:
25+
- opened
26+
- reopened
27+
- synchronize
28+
- labeled
2929
paths:
3030
- 'generative-ai/snippets/**'
3131
- '.github/workflows/generative-ai-snippets.yaml'
3232
schedule:
33-
- cron: '0 0 * * 0'
33+
- cron: '0 0 * * 0'
3434
jobs:
3535
test:
3636
if: github.event.action != 'labeled' || github.event.label.name == 'actions:force-run'
@@ -59,20 +59,19 @@ jobs:
5959
caip_id:nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-caip-project-id
6060
location:nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-location
6161
datastore_id:nodejs-docs-samples-tests/nodejs-docs-samples-ai-platform-datastore-id
62-
- uses: actions/[email protected]
62+
- uses: actions/[email protected]
6363
with:
6464
node-version: 18
6565
- name: Get npm cache directory
6666
id: npm-cache-dir
6767
shell: bash
68-
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
68+
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
6969
- uses: actions/cache@v3
7070
id: npm-cache
7171
with:
7272
path: ${{ steps.npm-cache-dir.outputs.dir }}
7373
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
74-
restore-keys: |
75-
${{ runner.os }}-node-
74+
restore-keys: "${{ runner.os }}-node- \n"
7675
- name: install repo dependencies
7776
run: npm install
7877
working-directory: .
@@ -89,8 +88,8 @@ jobs:
8988
env:
9089
GOOGLE_SAMPLES_PROJECT: "long-door-651"
9190
LOCATION: ${{ steps.secrets.outputs.location }}
92-
CAIP_PROJECT_ID: ${{ steps.secrets.outputs.caip_id }}
93-
DATASTORE_ID: ${{ steps.secrets.outputs.datastore_id }}
91+
CAIP_PROJECT_ID: ${{ steps.secrets.outputs.caip_id }}
92+
DATASTORE_ID: ${{ steps.secrets.outputs.datastore_id }}
9493
- name: upload test results for FlakyBot workflow
9594
if: github.event.action == 'schedule' && always()
9695
uses: actions/upload-artifact@v3
@@ -99,7 +98,7 @@ jobs:
9998
with:
10099
name: test-results
101100
path: generative-ai/snippets/${{ env.MOCHA_REPORTER_OUTPUT }}
102-
retention-days: 1
101+
retention-days: 1
103102
flakybot:
104103
permissions:
105104
contents: 'read'

0 commit comments

Comments
 (0)