wzieba / Firebase-Distribution-Github-Action

This action uploads artifacts (.apk or .ipa) to Firebase App Distribution.
MIT License
362 stars 76 forks source link

Failed to authenticate, have you run firebase login? #108

Open dhruvin22 opened 1 year ago

dhruvin22 commented 1 year ago

Firebase Authentication not working github action

    - name: Upload APK to Firebase App Distribution
      uses: wzieba/Firebase-Distribution-Github-Action@v1.5.0
      with:
        appId: ${{ secrets.FIREBASE_APP_ID }}
        serviceCredentialsFileContent: ${{ secrets.SERVICE_CRED }}
        groups: ${{ secrets.FIREBASE_TESTERS }}
        file: app/build/outputs/apk/debug/app.apk
        debug: true
Run wzieba/Firebase-Distribution-Github-Action@v1.5.0
/usr/bin/docker run --name ed866e2b624863a366400f84f2ea5a12176926_47a26b --label ed866e --workdir /github/workspace --rm -e "ETOLL_APP" -e "RUC_APP" -e "SETUP" -e "JAVA_HOME" -e "JAVA_HOME_17_X64" -e "ANDROID_HOME" 
-e "ANDROID_SDK_ROOT" -e "APP_ID" -e "APP_NAME" -e "INPUT_APPID" -e "INPUT_SERVICECREDENTIALSFILECONTENT" -e 
"INPUT_GROUPS" -e "INPUT_FILE" -e "INPUT_DEBUG" -e "INPUT_TOKEN" -e "INPUT_SERVICECREDENTIALSFILE" -e "INPUT_TESTERS" -e "INPUT_RELEASENOTES" -e "INPUT_RELEASENOTESFILE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e 
"GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e 
"GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID"
 -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW"
 -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" 
-e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e 
"GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" 
-e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "GITHUB_ACTION_PATH" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" 
-e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" 
-e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true
 -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home"
 -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" 
-v "/home/runner/work/android-apps/android-apps":"/github/workspace" ed866e:2b624863a366400f81f2e25a12176926

Error: Failed to authenticate, have you run firebase login?

Maybe this error occurred due to Firebase CIL tool updates.....

dhruvin22 commented 1 year ago

Alternative way to deployment https://firebase.google.com/docs/app-distribution/android/distribute-gradle

RodrigoPorras commented 10 months ago

In my case i was using a double tunnel to call a workflow in another project, please add secrets: inherit to pass the secrets to the other (each tunnel needs that) project. this error is because the project cant read the secrets.

jobs:
  call-workflow-passing-data:
    uses: octo-org/example-repo/.github/workflows/reusable-workflow.yml@main
    secrets: inherit
mrctrifork commented 8 months ago

Facing same issue. Is this the only way of doing this?

I can use the gradle plugin to distribute the app but I would've expected this workflow to work too

quetool commented 7 months ago

you need to use serviceCredentialsFileContent: ${{CREDENTIAL_FILE_CONTENT}}

https://github.com/wzieba/Firebase-Distribution-Github-Action/wiki/FIREBASE_TOKEN-migration

OP is using serviceCredentialsFileContent as so do I, and it's failing. I also tried serviceCredentialsFile (file path).

nihal-projectolympus commented 4 months ago

Hi @quetool, @dhruvin22. I was facing a similar issue in a shell script I wrote, similar to the one in this action.

Solution: Reformat the CREDENTIAL_FILE_CONTENT json, and escape the \n's in the "private_key" field.

Example: "private_key": "-----BEGIN PRIVATE KEY-----\\n***\\n***\\n***\\n***\\n***\\n***\\n***\n-----END PRIVATE KEY-----\\n"