Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticaton warning when using application default credentials #594

Closed
jorob16 opened this issue Nov 19, 2022 · 3 comments
Closed

Authenticaton warning when using application default credentials #594

jorob16 opened this issue Nov 19, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@jorob16
Copy link

jorob16 commented Nov 19, 2022

TL;DR

I'm running a self-hosted GitHub Actions runner on a GKE cluster. Permissions are handled through application default credentials (Workload Identity) and my workflow works correctly (no authorization errors). Unfortunately setup-gcloud still spits out a warning: **Warning**: No authentication found for gcloud, authenticate with google-github-actions/auth.

afbeelding
afbeelding

Expected behavior

I did not expect a warning, considering that the workflow works correctly and interacts with multiple GCP services for which authorization is definitely required.

Observed behavior

An authentication warning is displayed in the workflow logs and as an annotation under the job overview.

Action YAML

name: CICD Bumpversion master
on: 
  push:
    branches:
      - master
    paths:
      - cicd-bumpversion/**
      - .github/workflows/cicd-bumpversion-master.yaml
jobs:
  build-image:
    name: Build and push image
    runs-on: [self-hosted, **REDACTED**]
    steps:
      - name: Set up Cloud SDK
        uses: google-github-actions/setup-gcloud@v1
      - name: Checkout
        uses: actions/checkout@v3
      - name: Build Docker image
        run: docker build -t **REDACTED**/cicd-bumpversion:latest .
        working-directory: cicd-bumpversion/
      - name: Push image to Container Registry
        run: |
          gcloud auth configure-docker
          docker push **REDACTED**/cicd-bumpversion:latest

Log output

No response

Additional information

No response

@jorob16 jorob16 added the bug Something isn't working label Nov 19, 2022
@sethvargo
Copy link
Member

Hi @jorob16

This is correct and this is just a warning. We emit a warning when there are no credentials set by the auth action. This is just a warning and can be safely ignored for your use case.

@kkroening
Copy link

kkroening commented Dec 15, 2022

this is just a warning

Here's what "just a warning" looks like for anyone hoping to use setup-gcloud in CI - e.g. to install_components: cloud-datastore-emulator for testing:

Warnings

It would be nice if there were a way to disable this message because it drowns out actual actionable information by desensitizing anyone from paying attention to the warning output.

@SteffenL
Copy link

SteffenL commented Apr 7, 2023

I tend to treat warnings as something that shouldn't be ignored, and in many cases I treat them as errors. It would be beneficial if we were able to disable the warning.

I do not use the google-github-actions/auth action beause it writes the service account credentials JSON file directly into the the working tree which leaves quite a bit of room for accidentally misplacing the file.

isarkis added a commit to isarkis/setup-gcloud that referenced this issue May 3, 2023
Addresses google-github-actions#594 by not throwing 'No authentication' warning
when using application default credentials.
isarkis added a commit to isarkis/setup-gcloud that referenced this issue May 4, 2023
Addresses google-github-actions#594 by not throwing 'No authentication' warning
when using application default credentials.
isarkis added a commit to isarkis/setup-gcloud that referenced this issue May 4, 2023
Addresses google-github-actions#594 by not throwing 'No authentication' warning
when using application default credentials.
isarkis added a commit to isarkis/setup-gcloud that referenced this issue May 20, 2023
Addresses google-github-actions#594 by not throwing 'No authentication' warning
when using application default credentials.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

4 participants