From 441840afb5ba8561887205aa613b3b81be45f629 Mon Sep 17 00:00:00 2001 From: Yi Hu Date: Thu, 11 Jul 2024 19:56:08 -0400 Subject: [PATCH] Fix Python test auth (#31850) * Fix Python test auth * Replace more places setup-gcloud@v0 -> auth@v1 * add setup cloud * Revert change on build_wheels --- .github/workflows/build_runner_image.yml | 6 ++---- .github/workflows/java_tests.yml | 6 ++---- .github/workflows/python_tests.yml | 7 +++---- .github/workflows/typescript_tests.yml | 6 ++---- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_runner_image.yml b/.github/workflows/build_runner_image.yml index 0492622f8847..703ff6f36b84 100644 --- a/.github/workflows/build_runner_image.yml +++ b/.github/workflows/build_runner_image.yml @@ -43,12 +43,10 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} - name: Authenticate on GCP if: github.ref == 'refs/heads/master' - uses: google-github-actions/setup-gcloud@v0 + uses: google-github-actions/auth@v1 with: - service_account_email: ${{ secrets.GCP_SA_EMAIL }} - service_account_key: ${{ secrets.GCP_SA_KEY }} + credentials_json: ${{ secrets.GCP_SA_KEY }} project_id: ${{ secrets.GCP_PROJECT_ID }} - export_default_credentials: true - name: GCloud Docker credential helper run: | gcloud auth configure-docker ${{env.docker_registry}} diff --git a/.github/workflows/java_tests.yml b/.github/workflows/java_tests.yml index 0e9d862f91a3..f176fe018d7c 100644 --- a/.github/workflows/java_tests.yml +++ b/.github/workflows/java_tests.yml @@ -179,12 +179,10 @@ jobs: java-version: 11 go-version: default - name: Authenticate on GCP - uses: google-github-actions/setup-gcloud@v0 + uses: google-github-actions/auth@v1 with: - service_account_email: ${{ secrets.GCP_SA_EMAIL }} - service_account_key: ${{ secrets.GCP_SA_KEY }} + credentials_json: ${{ secrets.GCP_SA_KEY }} project_id: ${{ secrets.GCP_PROJECT_ID }} - export_default_credentials: true - name: Run WordCount uses: ./.github/actions/gradle-command-self-hosted-action with: diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index efc5af84c4bc..be1659fec437 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -175,12 +175,11 @@ jobs: name: python_sdk_source path: apache-beam-source - name: Authenticate on GCP - uses: google-github-actions/setup-gcloud@v0 + id: auth + uses: google-github-actions/auth@v1 with: - service_account_email: ${{ secrets.GCP_SA_EMAIL }} - service_account_key: ${{ secrets.GCP_SA_KEY }} + credentials_json: ${{ secrets.GCP_SA_KEY }} project_id: ${{ secrets.GCP_PROJECT_ID }} - export_default_credentials: true - name: Install requirements working-directory: ./sdks/python run: pip install setuptools --upgrade && pip install -e ".[gcp]" diff --git a/.github/workflows/typescript_tests.yml b/.github/workflows/typescript_tests.yml index 0fdcfb070a22..1b45ea67b5c6 100644 --- a/.github/workflows/typescript_tests.yml +++ b/.github/workflows/typescript_tests.yml @@ -147,12 +147,10 @@ jobs: pip install 'pandas>=1.0,<1.5' pip install -e ".[gcp]" - name: Authenticate on GCP - uses: google-github-actions/setup-gcloud@v0 + uses: google-github-actions/auth@v1 with: - service_account_email: ${{ secrets.GCP_SA_EMAIL }} - service_account_key: ${{ secrets.GCP_SA_KEY }} + credentials_json: ${{ secrets.GCP_SA_KEY }} project_id: ${{ secrets.GCP_PROJECT_ID }} - export_default_credentials: true - run: npm ci working-directory: ./sdks/typescript - run: npm run build