-
Notifications
You must be signed in to change notification settings - Fork 76
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.
- Follow the instructions described in the official documentation until reaching point 3 (create and download private JSON key).
- 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 isCREDENTIAL_FILE_CONTENT
). - Update configuration of Github Action:
- remove the
token
parameter - add
serviceCredentialsFileContent
with value of secret created in point 2.
- remove the
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
- Open Google Cloud Console
- Select your project

- Click on
Create Service Account

- Enter some account name, press
Create and continue

- Select
Firebase App Distribution Admin
inRole
input and clickDone

- Then, on the list of accounts find your newly created service account. Click on 3-dots menu and click on
Manage keys

- Click on
Add key
and thenCreate new key

- Select type
JSON
and clickCreate

- After that, the file should be downloaded to your disk. Open the file, and copy its content.
- Go to GitHub > your repository >
Settings
>Secrets
>Actions
- 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. - Save the secret. Important! Remember to remove the fetched file from your disk or store it in some secure place.
- 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