google-github-actions / setup-gcloud

A GitHub Action for installing and configuring the gcloud CLI.
https://cloud.google.com/sdk/docs
Apache License 2.0
1.71k stars 510 forks source link

gsutil showing "Your credentials are invalid. Please run $ gcloud auth login" #645

Closed SPTKL closed 1 year ago

SPTKL commented 1 year ago

TL;DR

I have a workflow that's using google-github-actions/auth@v1 with WIF and google-github-actions/setup-gcloud@v1, the authentication appears to be successful, however, gsutil throws Your credentials are invalid. Please run $ gcloud auth login when running a simple gsutil rsync command

Expected behavior

gsutil should be automatically authenticated after the authentication step using google-github-actions/auth@v1 and all gsutil related commands should work

Observed behavior

It appears that gsutil didn't pick up the creds created in the authentication step

Run gsutil ls gs://$GCS_BUCKET/dags

Your credentials are invalid. Please run
$ gcloud auth login
Error: Process completed with exit code 1.

Action YAML

name: Test and Deploy

on:
  pull_request:
    branches:
      - main
    paths:
      - "dags/**"
    types:
      - synchronize
      - opened

jobs:
  deploy-to-composer:
    runs-on: ubuntu-latest
    environment: development
    permissions:
      contents: 'read'
      id-token: 'write'
    steps:
    - uses: actions/checkout@v3

    - name: Authenticate to Google Cloud
      uses: google-github-actions/auth@v1
      with:
        workload_identity_provider: '${{ vars.WORKLOAD_IDENTITY_PROVIDER }}'
        service_account: '${{ vars.SERVICE_ACCOUNT }}'

    - name: Set up gcloud
      uses: google-github-actions/setup-gcloud@v1

    - name: show gcloud version
      run: gcloud --version

    - name: show authenticated account
      run: gcloud auth list

    - name: try gsutil
      env:
        GCS_BUCKET: ${{ vars.GCS_BUCKET }}
      run: gsutil ls gs://$GCS_BUCKET/dags

    - name: Copy to bucket
      env:
        GCS_BUCKET: ${{ vars.GCS_BUCKET }}
      run: gsutil -m rsync -r dags gs://$GCS_BUCKET/dags

Log output

2023-07-19T14:27:14.5456622Z Requested labels: ubuntu-latest
2023-07-19T14:27:14.5457002Z Job defined at: myorg/myrepo/.github/workflows/pr.yml@refs/pull/2/merge
2023-07-19T14:27:14.5457142Z Waiting for a runner to pick up this job...
2023-07-19T14:27:14.7476577Z Job is waiting for a hosted runner to come online.
2023-07-19T14:27:17.8905670Z Job is about to start running on the hosted runner: GitHub Actions 2 (hosted)
2023-07-19T14:27:20.2380264Z Current runner version: '2.306.0'
2023-07-19T14:27:20.2405696Z ##[group]Operating System
2023-07-19T14:27:20.2406242Z Ubuntu
2023-07-19T14:27:20.2406472Z 22.04.2
2023-07-19T14:27:20.2406732Z LTS
2023-07-19T14:27:20.2407070Z ##[endgroup]
2023-07-19T14:27:20.2407604Z ##[group]Runner Image
2023-07-19T14:27:20.2407966Z Image: ubuntu-22.04
2023-07-19T14:27:20.2408280Z Version: 20230710.1.0
2023-07-19T14:27:20.2408733Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230710.1/images/linux/Ubuntu2204-Readme.md
2023-07-19T14:27:20.2409388Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230710.1
2023-07-19T14:27:20.2409825Z ##[endgroup]
2023-07-19T14:27:20.2410154Z ##[group]Runner Image Provisioner
2023-07-19T14:27:20.2410431Z 2.0.238.1
2023-07-19T14:27:20.2410736Z ##[endgroup]
2023-07-19T14:27:20.2411324Z ##[group]GITHUB_TOKEN Permissions
2023-07-19T14:27:20.2411845Z Contents: read
2023-07-19T14:27:20.2412167Z Metadata: read
2023-07-19T14:27:20.2412698Z ##[endgroup]
2023-07-19T14:27:20.2415206Z Secret source: Actions
2023-07-19T14:27:20.2415611Z Prepare workflow directory
2023-07-19T14:27:20.3172611Z Prepare all required actions
2023-07-19T14:27:20.3364799Z Getting action download info
2023-07-19T14:27:20.8691305Z Download action repository 'actions/checkout@v3' (SHA:c85c95e3d7251135ab7dc9ce3241c5835cc595a9)
2023-07-19T14:27:21.1918873Z Download action repository 'google-github-actions/auth@v1' (SHA:35b0e87d162680511bf346c299f71c9c5c379033)
2023-07-19T14:27:21.3932309Z Download action repository 'google-github-actions/setup-gcloud@v1' (SHA:e30db14379863a8c79331b04a9969f4c1e225e0b)
2023-07-19T14:27:21.7250771Z Complete job name: deploy-to-composer
2023-07-19T14:27:21.8438273Z ##[group]Run actions/checkout@v3
2023-07-19T14:27:21.8438554Z with:
2023-07-19T14:27:21.8438771Z   repository: myorg/myrepo
2023-07-19T14:27:21.8439202Z   token: ***
2023-07-19T14:27:21.8439390Z   ssh-strict: true
2023-07-19T14:27:21.8439630Z   persist-credentials: true
2023-07-19T14:27:21.8439869Z   clean: true
2023-07-19T14:27:21.8440087Z   sparse-checkout-cone-mode: true
2023-07-19T14:27:21.8440321Z   fetch-depth: 1
2023-07-19T14:27:21.8440522Z   lfs: false
2023-07-19T14:27:21.8440721Z   submodules: false
2023-07-19T14:27:21.8440929Z   set-safe-directory: true
2023-07-19T14:27:21.8441155Z ##[endgroup]
2023-07-19T14:27:22.0699429Z Syncing repository: myorg/myrepo
2023-07-19T14:27:22.0705127Z ##[group]Getting Git version info
2023-07-19T14:27:22.0705725Z Working directory is '/home/runner/work/myrepo/myrepo'
2023-07-19T14:27:22.0749312Z [command]/usr/bin/git version
2023-07-19T14:27:22.0751485Z git version 2.41.0
2023-07-19T14:27:22.0756697Z ##[endgroup]
2023-07-19T14:27:22.0772726Z Temporarily overriding HOME='/home/runner/work/_temp/31795d41-6751-4cbb-a30e-b2dd30c4c3b3' before making global git config changes
2023-07-19T14:27:22.0773382Z Adding repository directory to the temporary git global config as a safe directory
2023-07-19T14:27:22.0774066Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/myrepo/myrepo
2023-07-19T14:27:22.0817916Z Deleting the contents of '/home/runner/work/myrepo/myrepo'
2023-07-19T14:27:22.0823279Z ##[group]Initializing the repository
2023-07-19T14:27:22.0827364Z [command]/usr/bin/git init /home/runner/work/myrepo/myrepo
2023-07-19T14:27:22.0894187Z hint: Using 'master' as the name for the initial branch. This default branch name
2023-07-19T14:27:22.0895235Z hint: is subject to change. To configure the initial branch name to use in all
2023-07-19T14:27:22.0895688Z hint: of your new repositories, which will suppress this warning, call:
2023-07-19T14:27:22.0895962Z hint: 
2023-07-19T14:27:22.0896405Z hint:  git config --global init.defaultBranch <name>
2023-07-19T14:27:22.0896656Z hint: 
2023-07-19T14:27:22.0896991Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2023-07-19T14:27:22.0897417Z hint: 'development'. The just-created branch can be renamed via this command:
2023-07-19T14:27:22.0897970Z hint: 
2023-07-19T14:27:22.0898210Z hint:  git branch -m <name>
2023-07-19T14:27:22.0905456Z Initialized empty Git repository in /home/runner/work/myrepo/myrepo/.git/
2023-07-19T14:27:22.0919256Z [command]/usr/bin/git remote add origin https://github.com/myorg/myrepo
2023-07-19T14:27:22.0958729Z ##[endgroup]
2023-07-19T14:27:22.0959659Z ##[group]Disabling automatic garbage collection
2023-07-19T14:27:22.0965370Z [command]/usr/bin/git config --local gc.auto 0
2023-07-19T14:27:22.0996344Z ##[endgroup]
2023-07-19T14:27:22.0996765Z ##[group]Setting up auth
2023-07-19T14:27:22.1005708Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2023-07-19T14:27:22.1042593Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2023-07-19T14:27:22.1364436Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2023-07-19T14:27:22.1396546Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2023-07-19T14:27:22.1630323Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2023-07-19T14:27:22.1669749Z ##[endgroup]
2023-07-19T14:27:22.1670449Z ##[group]Fetching the repository
2023-07-19T14:27:22.1685485Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +f89564a455fb5528030b0e56d45dd98e80e06532:refs/remotes/pull/2/merge
2023-07-19T14:27:22.4453979Z remote: Enumerating objects: 23, done.        
2023-07-19T14:27:22.4454370Z remote: Counting objects:   4% (1/23)        
2023-07-19T14:27:22.4454636Z remote: Counting objects:   8% (2/23)        
2023-07-19T14:27:22.4454894Z remote: Counting objects:  13% (3/23)        
2023-07-19T14:27:22.4455166Z remote: Counting objects:  17% (4/23)        
2023-07-19T14:27:22.4455471Z remote: Counting objects:  21% (5/23)        
2023-07-19T14:27:22.4455719Z remote: Counting objects:  26% (6/23)        
2023-07-19T14:27:22.4455969Z remote: Counting objects:  30% (7/23)        
2023-07-19T14:27:22.4456204Z remote: Counting objects:  34% (8/23)        
2023-07-19T14:27:22.4456445Z remote: Counting objects:  39% (9/23)        
2023-07-19T14:27:22.4456692Z remote: Counting objects:  43% (10/23)        
2023-07-19T14:27:22.4456928Z remote: Counting objects:  47% (11/23)        
2023-07-19T14:27:22.4457169Z remote: Counting objects:  52% (12/23)        
2023-07-19T14:27:22.4457434Z remote: Counting objects:  56% (13/23)        
2023-07-19T14:27:22.4457673Z remote: Counting objects:  60% (14/23)        
2023-07-19T14:27:22.4457910Z remote: Counting objects:  65% (15/23)        
2023-07-19T14:27:22.4458153Z remote: Counting objects:  69% (16/23)        
2023-07-19T14:27:22.4458392Z remote: Counting objects:  73% (17/23)        
2023-07-19T14:27:22.4458633Z remote: Counting objects:  78% (18/23)        
2023-07-19T14:27:22.4458873Z remote: Counting objects:  82% (19/23)        
2023-07-19T14:27:22.4459110Z remote: Counting objects:  86% (20/23)        
2023-07-19T14:27:22.4459337Z remote: Counting objects:  91% (21/23)        
2023-07-19T14:27:22.4459569Z remote: Counting objects:  95% (22/23)        
2023-07-19T14:27:22.4459805Z remote: Counting objects: 100% (23/23)        
2023-07-19T14:27:22.4460054Z remote: Counting objects: 100% (23/23), done.        
2023-07-19T14:27:22.4460347Z remote: Compressing objects:   5% (1/18)        
2023-07-19T14:27:22.4460738Z remote: Compressing objects:  11% (2/18)        
2023-07-19T14:27:22.4460997Z remote: Compressing objects:  16% (3/18)        
2023-07-19T14:27:22.4461269Z remote: Compressing objects:  22% (4/18)        
2023-07-19T14:27:22.4461528Z remote: Compressing objects:  27% (5/18)        
2023-07-19T14:27:22.4461794Z remote: Compressing objects:  33% (6/18)        
2023-07-19T14:27:22.4462352Z remote: Compressing objects:  38% (7/18)        
2023-07-19T14:27:22.4462604Z remote: Compressing objects:  44% (8/18)        
2023-07-19T14:27:22.4462861Z remote: Compressing objects:  50% (9/18)        
2023-07-19T14:27:22.4490611Z remote: Compressing objects:  55% (10/18)        
2023-07-19T14:27:22.4490916Z remote: Compressing objects:  61% (11/18)        
2023-07-19T14:27:22.4491185Z remote: Compressing objects:  66% (12/18)        
2023-07-19T14:27:22.4491437Z remote: Compressing objects:  72% (13/18)        
2023-07-19T14:27:22.4491703Z remote: Compressing objects:  77% (14/18)        
2023-07-19T14:27:22.4491963Z remote: Compressing objects:  83% (15/18)        
2023-07-19T14:27:22.4492215Z remote: Compressing objects:  88% (16/18)        
2023-07-19T14:27:22.4492457Z remote: Compressing objects:  94% (17/18)        
2023-07-19T14:27:22.4492714Z remote: Compressing objects: 100% (18/18)        
2023-07-19T14:27:22.4492990Z remote: Compressing objects: 100% (18/18), done.        
2023-07-19T14:27:22.4731778Z remote: Total 23 (delta 0), reused 12 (delta 0), pack-reused 0        
2023-07-19T14:27:22.4885923Z From https://github.com/myorg/myrepo
2023-07-19T14:27:22.4886884Z  * [new ref]         f89564a455fb5528030b0e56d45dd98e80e06532 -> pull/2/merge
2023-07-19T14:27:22.4929609Z ##[endgroup]
2023-07-19T14:27:22.4930547Z ##[group]Determining the checkout info
2023-07-19T14:27:22.4931088Z ##[endgroup]
2023-07-19T14:27:22.4931897Z ##[group]Checking out the ref
2023-07-19T14:27:22.4932588Z [command]/usr/bin/git checkout --progress --force refs/remotes/pull/2/merge
2023-07-19T14:27:22.4998523Z Note: switching to 'refs/remotes/pull/2/merge'.
2023-07-19T14:27:22.4999255Z 
2023-07-19T14:27:22.5000163Z You are in 'detached HEAD' state. You can look around, make experimental
2023-07-19T14:27:22.5000749Z changes and commit them, and you can discard any commits you make in this
2023-07-19T14:27:22.5001817Z state without impacting any branches by switching back to a branch.
2023-07-19T14:27:22.5002173Z 
2023-07-19T14:27:22.5002418Z If you want to create a new branch to retain commits you create, you may
2023-07-19T14:27:22.5002934Z do so (now or later) by using -c with the switch command. Example:
2023-07-19T14:27:22.5003676Z 
2023-07-19T14:27:22.5003990Z   git switch -c <new-branch-name>
2023-07-19T14:27:22.5004245Z 
2023-07-19T14:27:22.5004445Z Or undo this operation with:
2023-07-19T14:27:22.5004678Z 
2023-07-19T14:27:22.5004837Z   git switch -
2023-07-19T14:27:22.5005034Z 
2023-07-19T14:27:22.5005293Z Turn off this advice by setting config variable advice.detachedHead to false
2023-07-19T14:27:22.5005595Z 
2023-07-19T14:27:22.5005994Z HEAD is now at f89564a Merge d9e4b0e9bb10551971113cd5892fbd8f3d983d2b into 6a529f67a881316c229b216705ad2cec11b0912e
2023-07-19T14:27:22.5021621Z ##[endgroup]
2023-07-19T14:27:22.5069536Z [command]/usr/bin/git log -1 --format='%H'
2023-07-19T14:27:22.5096711Z 'f89564a455fb5528030b0e56d45dd98e80e06532'
2023-07-19T14:27:22.5455674Z ##[group]Run google-github-actions/auth@v1
2023-07-19T14:27:22.5455937Z with:
2023-07-19T14:27:22.5456277Z   workload_identity_provider: projects/**********/locations/global/workloadIdentityPools/this/providers/this
2023-07-19T14:27:22.5456735Z   service_account: **********@**********.iam.gserviceaccount.com
2023-07-19T14:27:22.5457045Z   create_credentials_file: true
2023-07-19T14:27:22.5457282Z   export_environment_variables: true
2023-07-19T14:27:22.5457518Z   cleanup_credentials: true
2023-07-19T14:27:22.5457735Z   access_token_lifetime: 3600s
2023-07-19T14:27:22.5458038Z   access_token_scopes: https://www.googleapis.com/auth/cloud-platform
2023-07-19T14:27:22.5458311Z   retries: 3
2023-07-19T14:27:22.5458484Z   backoff: 250
2023-07-19T14:27:22.5458685Z   id_token_include_email: false
2023-07-19T14:27:22.5458891Z ##[endgroup]
2023-07-19T14:27:22.7005227Z Created credentials file at "/home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json"
2023-07-19T14:27:22.7144473Z ##[group]Run google-github-actions/setup-gcloud@v1
2023-07-19T14:27:22.7144920Z with:
2023-07-19T14:27:22.7145114Z   skip_install: false
2023-07-19T14:27:22.7145318Z   version: latest
2023-07-19T14:27:22.7145521Z env:
2023-07-19T14:27:22.7145848Z   CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:22.7146655Z   GOOGLE_APPLICATION_CREDENTIALS: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:22.7147798Z   GOOGLE_GHA_CREDS_PATH: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:22.7148478Z   CLOUDSDK_CORE_PROJECT: **********
2023-07-19T14:27:22.7148734Z   CLOUDSDK_PROJECT: **********
2023-07-19T14:27:22.7148977Z   GCLOUD_PROJECT: **********
2023-07-19T14:27:22.7149495Z   GCP_PROJECT: **********
2023-07-19T14:27:22.7149763Z   GOOGLE_CLOUD_PROJECT: **********
2023-07-19T14:27:22.7149975Z ##[endgroup]
2023-07-19T14:27:26.4273705Z [command]/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/535c7ec9-4e36-413a-99ea-b5d0ac1c2b64 -f /home/runner/work/_temp/cb84d393-d4f6-4820-bd9d-e4d298d59055
2023-07-19T14:27:43.9014153Z Successfully authenticated
2023-07-19T14:27:43.9187039Z ##[group]Run gcloud --version
2023-07-19T14:27:43.9187362Z gcloud --version
2023-07-19T14:27:43.9249329Z shell: /usr/bin/bash -e {0}
2023-07-19T14:27:43.9249550Z env:
2023-07-19T14:27:43.9249934Z   CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:43.9250387Z   GOOGLE_APPLICATION_CREDENTIALS: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:43.9250805Z   GOOGLE_GHA_CREDS_PATH: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:43.9251123Z   CLOUDSDK_CORE_PROJECT: **********
2023-07-19T14:27:43.9251376Z   CLOUDSDK_PROJECT: **********
2023-07-19T14:27:43.9251612Z   GCLOUD_PROJECT: **********
2023-07-19T14:27:43.9251840Z   GCP_PROJECT: **********
2023-07-19T14:27:43.9252077Z   GOOGLE_CLOUD_PROJECT: **********
2023-07-19T14:27:43.9252373Z   CLOUDSDK_METRICS_ENVIRONMENT: github-actions-setup-gcloud
2023-07-19T14:27:43.9252731Z   CLOUDSDK_METRICS_ENVIRONMENT_VERSION: 1.1.1
2023-07-19T14:27:43.9252963Z ##[endgroup]
2023-07-19T14:27:44.4804970Z Google Cloud SDK 439.0.0
2023-07-19T14:27:44.4805597Z bq 2.0.94
2023-07-19T14:27:44.4806543Z bundled-python3-unix 3.9.16
2023-07-19T14:27:44.4806932Z core 2023.07.14
2023-07-19T14:27:44.4807731Z gcloud-crc32c 1.0.0
2023-07-19T14:27:44.4808282Z gsutil 5.25
2023-07-19T14:27:44.5671836Z ##[group]Run gcloud auth list
2023-07-19T14:27:44.5672087Z gcloud auth list
2023-07-19T14:27:44.5725434Z shell: /usr/bin/bash -e {0}
2023-07-19T14:27:44.5725653Z env:
2023-07-19T14:27:44.5725979Z   CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:44.5726432Z   GOOGLE_APPLICATION_CREDENTIALS: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:44.5726872Z   GOOGLE_GHA_CREDS_PATH: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:44.5727197Z   CLOUDSDK_CORE_PROJECT: **********
2023-07-19T14:27:44.5727587Z   CLOUDSDK_PROJECT: **********
2023-07-19T14:27:44.5727815Z   GCLOUD_PROJECT: **********
2023-07-19T14:27:44.5728053Z   GCP_PROJECT: **********
2023-07-19T14:27:44.5728287Z   GOOGLE_CLOUD_PROJECT: **********
2023-07-19T14:27:44.5728586Z   CLOUDSDK_METRICS_ENVIRONMENT: github-actions-setup-gcloud
2023-07-19T14:27:44.5728932Z   CLOUDSDK_METRICS_ENVIRONMENT_VERSION: 1.1.1
2023-07-19T14:27:44.5729158Z ##[endgroup]
2023-07-19T14:27:45.1203662Z                      Credentialed Accounts
2023-07-19T14:27:45.1204872Z 
2023-07-19T14:27:45.1204975Z ACTIVE  ACCOUNT
2023-07-19T14:27:45.1205951Z To set the active account, run:
2023-07-19T14:27:45.1206523Z *       **********@**********.iam.gserviceaccount.com
2023-07-19T14:27:45.1296915Z     $ gcloud config set account `ACCOUNT`
2023-07-19T14:27:45.1297412Z 
2023-07-19T14:27:45.2090823Z ##[group]Run gsutil ls gs://$GCS_BUCKET/dags
2023-07-19T14:27:45.2091117Z gsutil ls gs://$GCS_BUCKET/dags
2023-07-19T14:27:45.2144286Z shell: /usr/bin/bash -e {0}
2023-07-19T14:27:45.2144508Z env:
2023-07-19T14:27:45.2144840Z   CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:45.2145296Z   GOOGLE_APPLICATION_CREDENTIALS: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:45.2145720Z   GOOGLE_GHA_CREDS_PATH: /home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json
2023-07-19T14:27:45.2146044Z   CLOUDSDK_CORE_PROJECT: **********
2023-07-19T14:27:45.2146295Z   CLOUDSDK_PROJECT: **********
2023-07-19T14:27:45.2146521Z   GCLOUD_PROJECT: **********
2023-07-19T14:27:45.2146750Z   GCP_PROJECT: **********
2023-07-19T14:27:45.2146986Z   GOOGLE_CLOUD_PROJECT: **********
2023-07-19T14:27:45.2147337Z   CLOUDSDK_METRICS_ENVIRONMENT: github-actions-setup-gcloud
2023-07-19T14:27:45.2147651Z   CLOUDSDK_METRICS_ENVIRONMENT_VERSION: 1.1.1
2023-07-19T14:27:45.2147938Z   GCS_BUCKET: ***********************
2023-07-19T14:27:45.2148189Z ##[endgroup]
2023-07-19T14:27:47.5538388Z Your credentials are invalid. Please run
2023-07-19T14:27:47.5539020Z $ gcloud auth login
2023-07-19T14:27:47.7217094Z ##[error]Process completed with exit code 1.
2023-07-19T14:27:47.7292278Z Post job cleanup.
2023-07-19T14:27:47.8029214Z Removed exported credentials at "/home/runner/work/myrepo/myrepo/gha-creds-8bdad8e8a832dce2.json".
2023-07-19T14:27:47.8104624Z Post job cleanup.
2023-07-19T14:27:47.9143384Z [command]/usr/bin/git version
2023-07-19T14:27:47.9190907Z git version 2.41.0
2023-07-19T14:27:47.9244967Z Temporarily overriding HOME='/home/runner/work/_temp/f264aadc-48d6-4f4a-a4bd-1b906cdc5868' before making global git config changes
2023-07-19T14:27:47.9248829Z Adding repository directory to the temporary git global config as a safe directory
2023-07-19T14:27:47.9256890Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/myrepo/myrepo
2023-07-19T14:27:47.9301646Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2023-07-19T14:27:47.9341099Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2023-07-19T14:27:47.9590694Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2023-07-19T14:27:47.9610213Z http.https://github.com/.extraheader
2023-07-19T14:27:47.9630436Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2023-07-19T14:27:47.9676817Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2023-07-19T14:27:48.0103754Z Cleaning up orphan processes

Additional information

everything runs successfully up until the gsutil steps I also tried to add additional step gcloud auth login --cred-file="$GOOGLE_APPLICATION_CREDENTIALS" --quiet the command above ran successfully, however, the gsutil step still failed

sethvargo commented 1 year ago

Can you run gcloud storage buckets list and provide the output? Since this occurs even when you manually authenticate, that potentially points to a bug in the Google Cloud SDK - was this previously working? Can you try a slightly older SDK version (e.g. 437.0.1) to see if the issue persists?

SPTKL commented 1 year ago

I'm getting

ERROR: (gcloud.storage.buckets.list) There was a problem refreshing your current auth tokens: ('Error code invalid_target: The target service indicated by the "audience" parameters is invalid. This might either be because the pool or provider is disabled or deleted or because it doesn\'t exist.', '{"error":"invalid_target","error_description":"The target service indicated by the \\"audience\\" parameters is invalid. This might either be because the pool or provider is disabled or deleted or because it doesn\'t exist."}')

seems like it might have to do with my WIF configurations, and not the actions, feel free to close this issue! thanks

sethvargo commented 1 year ago

Most likely - check out https://github.com/google-github-actions/auth/blob/main/docs/TROUBLESHOOTING.md. If that doesn't help, file an issue on https://github.com/google-github-actions/auth please. Thanks!