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.72k stars 509 forks source link

ERROR: (gcloud.auth.login) unrecognized arguments: --cred-file (did you mean '--flags-file'?) #639

Closed YangJiao0817 closed 1 year ago

YangJiao0817 commented 1 year ago

TL;DR

google-github-actions/setup-gcloud@v1 reported an error ERROR: (gcloud.auth.login) unrecognized arguments: --cred-file (did you mean '--flags-file'?)

Expected behavior

No response

Observed behavior

No response

Action YAML

      - uses: 'google-github-actions/auth@v1'
        with:
          credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
      - uses: google-github-actions/setup-gcloud@v1
        with:
          version: '285.0.0'

### Log output

```text
Run google-github-actions/setup-gcloud@v1
  with:
    version: 285.0.0
    skip_install: false
  env:
    DOCKER_COMPOSE_VERSION: 1.23.0
    BUILD_PACKAGE: true
    CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE: /home/runner/work/harbor/harbor/gha-creds-3d9bf86c4a872dbf.json
    GOOGLE_APPLICATION_CREDENTIALS: /home/runner/work/harbor/harbor/gha-creds-3d9bf86c4a872dbf.json
    GOOGLE_GHA_CREDS_PATH: /home/runner/work/harbor/harbor/gha-creds-3d9bf86c4a872dbf.json
    CLOUDSDK_CORE_PROJECT: eminent-nation-87317
    CLOUDSDK_PROJECT: eminent-nation-87317
    GCLOUD_PROJECT: eminent-nation-87317
    GCP_PROJECT: eminent-nation-87317
    GOOGLE_CLOUD_PROJECT: eminent-nation-87317
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/a75d5fee-7821-499e-883c-b8edc55446ce -f /home/runner/work/_temp/a202e60a-86c2-4a31-b6bc-44abf9aa10d3
Error: google-github-actions/setup-gcloud failed with: failed to execute command `gcloud --quiet auth login --force --cred-file /home/runner/work/harbor/harbor/gha-creds-3d9bf86c4a872dbf.json`: ERROR: (gcloud.auth.login) unrecognized arguments: --cred-file (did you mean '--flags-file'?) 

Additional information

No response

sethvargo commented 1 year ago

Hi @YangJiao0817

gcloud version 285.0.0 is over 3 years old. Are you able to use a more recent version like 430.0.0?

YangJiao0817 commented 1 year ago

@sethvargo Thanks, this worked.