You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the docs and included my credentials json as a one line secret in an environment for my github action, yet I get this error
Error: google-github-actions/auth failed with: failed to parse service account key JSON credentials: unexpected token '�', "�*^���ǿi�("... is not valid JSON
Expected behavior
For it to accept the json in the secret
Observed behavior
It did not accept the json in the secret
Action YAML
name: Deploy to Google Cloud Functionson:
push:
branches:
- main # or your default branchworkflow_dispatch: # allows manual triggersjobs:
deploy:
runs-on: ubuntu-latestenvironment: cicdsteps:
- uses: actions/checkout@v4
- name: Set up Node.jsuses: actions/setup-node@v4with:
node-version: '>=22.0.0'cache: 'npm'
- name: Install dependenciesrun: npm ci
- name: Buildrun: npm run build
- id: 'auth'uses: google-github-actions/auth@v2with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'project_id: ${{ vars.GCP_PROJECT_ID }}
- name: Setup Google Cloud SDKuses: google-github-actions/setup-gcloud@v2with:
project_id: ${{ vars.GCP_PROJECT_ID }}
- name: Deploy to Cloud Run Functionsrun: | just deploy
Log output
Run google-github-actions/auth@v2
with:
credentials_json: ***
project_id: swap-routing-api-dev
create_credentials_file: true
export_environment_variables: true
universe: googleapis.com
cleanup_credentials: true
access_token_lifetime: 3600s
access_token_scopes: https://www.googleapis.com/auth/cloud-platform
id_token_include_email: false
Error: google-github-actions/auth failed with: failed to parse service account key JSON credentials: unexpected token '�', "�*^���ǿi�("... is not valid JSON
Additional information
No response
The text was updated successfully, but these errors were encountered:
Thank you for opening an issue. Our team will triage this as soon as we can. Please take a moment to review the troubleshooting steps which lists common error messages and their resolution steps.
My issue was caused because the json was wrapped in single quotes in the secret value. I think they did not play well with the single quotes in the example usage, i.e. credentials_json: '${{ secrets.GCP_SA_KEY }}'
TL;DR
I followed the docs and included my credentials json as a one line secret in an environment for my github action, yet I get this error
Expected behavior
For it to accept the json in the secret
Observed behavior
It did not accept the json in the secret
Action YAML
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: