From e3dd96af1945e6a2e15c532cfdb5e74ea0d9e3da Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Mon, 12 May 2025 12:18:47 -0700 Subject: [PATCH 1/3] fix: support tests on forked repos --- run/helloworld/index.js | 2 ++ tpu/createVM.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/run/helloworld/index.js b/run/helloworld/index.js index 5f3289de8a..be909d3705 100644 --- a/run/helloworld/index.js +++ b/run/helloworld/index.js @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// TODO: remove this comment, used to trigger tests + // [START cloudrun_helloworld_service] import express from 'express'; const app = express(); diff --git a/tpu/createVM.js b/tpu/createVM.js index 5da266fd5f..0a6ab5deb9 100644 --- a/tpu/createVM.js +++ b/tpu/createVM.js @@ -14,6 +14,8 @@ * limitations under the License. */ +// TODO: remove this comment, used to trigger tests + 'use strict'; async function main(tpuClient) { From 00f2e48abab3124f1e6865114d2ce3871b29c924 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Mon, 12 May 2025 12:45:30 -0700 Subject: [PATCH 2/3] checkout and auth as separate steps --- .github/workflows/custard-run-dev.yaml | 17 ++++++++++++++--- .github/workflows/custard-run.yaml | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/custard-run-dev.yaml b/.github/workflows/custard-run-dev.yaml index fec32e468d..2f4a8dce47 100644 --- a/.github/workflows/custard-run-dev.yaml +++ b/.github/workflows/custard-run-dev.yaml @@ -80,14 +80,25 @@ jobs: name: (experimental / dev) Custard CI / ${{ github.job }} (${{ matrix.path }}) job-name: ${{ github.job }} (${{ matrix.path }}) if: ${{ !!github.event.workflow_run }} + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: Authenticate + uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10 + id: auth + with: + project_id: ${{ env.GOOGLE_SAMPLES_PROJECT }} + workload_identity_provider: projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider + service_account: ${{ env.GOOGLE_SERVICE_ACCOUNT }} + access_token_lifetime: 600s # 10 minutes + token_format: id_token + id_token_audience: https://action.test/ # service must have this custom audience + id_token_include_email: true - name: Setup Custard uses: GoogleCloudPlatform/cloud-samples-tools/actions/steps/setup-custard@9ee708234e240605d96e78f652c333ed6aa95a23 # v0.3.2 with: path: ${{ matrix.path }} ci-setup: ${{ toJson(fromJson(needs.affected.outputs.ci-setups)[matrix.path]) }} - project-id: ${{ env.GOOGLE_SAMPLES_PROJECT }} - workload-identity-provider: projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider - service-account: ${{ env.GOOGLE_SERVICE_ACCOUNT }} + id-token: ${{ steps.auth.outputs.id_token }} - name: Check in_progress uses: GoogleCloudPlatform/cloud-samples-tools/actions/steps/update-check@9ee708234e240605d96e78f652c333ed6aa95a23 # v0.3.2 id: in_progress diff --git a/.github/workflows/custard-run.yaml b/.github/workflows/custard-run.yaml index 0d4fe08c32..91b28a0c94 100644 --- a/.github/workflows/custard-run.yaml +++ b/.github/workflows/custard-run.yaml @@ -124,14 +124,25 @@ jobs: name: (experimental) Custard CI / ${{ github.job }} (${{ matrix.path }}) job-name: ${{ github.job }} (${{ matrix.path }}) if: ${{ !!github.event.workflow_run }} + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: Authenticate + uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10 + id: auth + with: + project_id: ${{ env.GOOGLE_SAMPLES_PROJECT }} + workload_identity_provider: projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider + service_account: ${{ env.GOOGLE_SERVICE_ACCOUNT }} + access_token_lifetime: 600s # 10 minutes + token_format: id_token + id_token_audience: https://action.test/ # service must have this custom audience + id_token_include_email: true - name: Setup Custard uses: GoogleCloudPlatform/cloud-samples-tools/actions/steps/setup-custard@9ee708234e240605d96e78f652c333ed6aa95a23 # v0.3.2 with: path: ${{ matrix.path }} ci-setup: ${{ toJson(fromJson(needs.affected.outputs.ci-setups)[matrix.path]) }} - project-id: ${{ env.GOOGLE_SAMPLES_PROJECT }} - workload-identity-provider: projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider - service-account: ${{ env.GOOGLE_SERVICE_ACCOUNT }} + id-token: ${{ steps.auth.outputs.id_token }} - name: Check in_progress uses: GoogleCloudPlatform/cloud-samples-tools/actions/steps/update-check@9ee708234e240605d96e78f652c333ed6aa95a23 # v0.3.2 id: in_progress From 202bfad7342131c33cb3f661bad63e8611bb5593 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Mon, 12 May 2025 12:50:00 -0700 Subject: [PATCH 3/3] remove changes to packages to trigger tests --- run/helloworld/index.js | 2 -- tpu/createVM.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/run/helloworld/index.js b/run/helloworld/index.js index be909d3705..5f3289de8a 100644 --- a/run/helloworld/index.js +++ b/run/helloworld/index.js @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// TODO: remove this comment, used to trigger tests - // [START cloudrun_helloworld_service] import express from 'express'; const app = express(); diff --git a/tpu/createVM.js b/tpu/createVM.js index 0a6ab5deb9..5da266fd5f 100644 --- a/tpu/createVM.js +++ b/tpu/createVM.js @@ -14,8 +14,6 @@ * limitations under the License. */ -// TODO: remove this comment, used to trigger tests - 'use strict'; async function main(tpuClient) {