Skip to content

FIREBASE_TOKEN migration

Wojciech Zięba edited this page Oct 23, 2022 · 5 revisions

Firebase CLI Tools announced the depreciation of token authentication in favor of Service Account (source).

This means that actions configured with the token parameter will stop working as soon as a new major version of firebase-tools is released.

Those guides are prepared to make migration from token to Service Account as easy as possible. They both lead to the same result but they differ in the level of detail. Choose what suits you best.


Guide 1 - TLDR;

  1. Follow the instructions described in the official documentation until reaching point 3 (create and download private JSON key).
  2. Create a new Secret in GitHub (Settings > Secrets > Actions) with the value of the content of the file generated in the previous point (in the sample below, the name of this secret is CREDENTIAL_FILE_CONTENT).
  3. Update configuration of Github Action:
    1. remove the token parameter
    2. add serviceCredentialsFileContent with value of secret created in point 2.

E.g.

    - name: upload artifact to Firebase App Distribution
      uses: wzieba/Firebase-Distribution-Github-Action@v1
      with:
        appId: ${{secrets.FIREBASE_APP_ID}}
-       token: ${{secrets.FIREBASE_TOKEN}}
+       serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
        groups: testers
        file: app/build/outputs/apk/release/app-release-unsigned.apk

Guide 2 - the same but with screenshots

  1. Open Google Cloud Console
  2. Select your project
Screenshot 2022-10-22 at 23 24 23
  1. Click on Create Service Account
Screenshot 2022-10-22 at 23 25 22
  1. Enter some account name, press Create and continue
Screenshot 2022-10-22 at 23 26 38
  1. Select Firebase App Distribution Admin in Role input and click Done
Screenshot 2022-10-22 at 23 27 53
  1. Then, on the list of accounts find your newly created service account. Click on 3-dots menu and click on Manage keys
Screenshot 2022-10-22 at 23 29 36
  1. Click on Add key and then Create new key
Screenshot 2022-10-22 at 23 30 40
  1. Select type JSON and click Create
Screenshot 2022-10-22 at 23 30 46
  1. After that, the file should be downloaded to your disk. Open the file, and copy its content.
  2. Go to GitHub > your repository > Settings > Secrets > Actions
  3. Create a new secret. Name it e.g. CREDENTIAL_FILE_CONTENT. The value of the secret is the content from the file copied in point 9.
  4. Save the secret. Important! Remember to remove the fetched file from your disk or store it in some secure place.
  5. Update the configuration of your GitHub Actions. E.g.

E.g.

    - name: upload artifact to Firebase App Distribution
      uses: wzieba/Firebase-Distribution-Github-Action@v1
      with:
        appId: ${{secrets.FIREBASE_APP_ID}}
-       token: ${{secrets.FIREBASE_TOKEN}}
+       serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
        groups: testers
        file: app/build/outputs/apk/release/app-release-unsigned.apk
Clone this wiki locally