question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

export_default_credentials: true isn't setting $GOOGLE_APPLICATION_CREDENTIALS for later steps

See original GitHub issue

TL;DR

I set export_default_credentials: true, and in later steps test failed due to missing credentials.

Expected behavior $GOOGLE_APPLICATION_CREDENTIALS should be set with the credentials for all later steps.

Reproduction

Action YAML

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
      with:
       version: '270.0.0'
       service_account_email: ${{ secrets.GCP_SA_STG_EMAIL }}
       service_account_key: ${{ secrets.GCP_SA_STG_KEY }}
       export_default_credentials: true
    - name: set gcp cradentilas
      run:  gcloud info
    - name: echo gcp cradentilas
      run:  echo this is  ${GOOGLE_APPLICATION_CREDENTIALS}  
    - uses: actions/checkout@v2
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Build with Maven
      run: mvn clean install --file pom.xml

Additional information I submitted in the past some PR that fixed it, when I run same action with that PR branch it works.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
sethvargocommented, Mar 31, 2020

@brachi-wernick remove the second actions/checkout@v2. Performing a checkout resets the workspace, effectively deleting the cached credentials. Again, this works with your PR because the credentials are saved outside of the workspace.

Note: the run failed because I do not have access to your bucket. However, the authentication is clearly selected as the error message now includes the service account name.

Please let me know if you have additional questions.

0reactions
brachi-wernickcommented, Apr 1, 2020

Hi @sethvargo. that helps! it works now! thanks on your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

export_default_credentials: true isn't setting $ ...
I set export_default_credentials: true , and in later steps test failed due to missing credentials. ... $GOOGLE_APPLICATION_CREDENTIALS should be ...
Read more >
Setting GOOGLE_APPLICATION_CREDENTIALS for ...
client.ApplicationDefaultCredentialsError: The Application Default Credentials are not available. They are available if running in Google Compute Engine.
Read more >
Error messages | Document AI
The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable ...
Read more >
Google Cloud Application Default Credentials - PHP
Google Cloud Application Default Credentials (ADC) is a strategy to locate sources that contain secrets/key material to create credentials.
Read more >
Get started with Cloud Firestore - Firebase
This quickstart shows you how to set up Cloud Firestore, add data, then view the data you just added in the Firebase console....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found