- .github/workflows/danger.yml
- demonstrates how to use Danger.
- .github/workflows/firebase-and-slack.yml
- demonstrates how to use:
- Firebase Test Lab
- Firebase App Distribution
- Slack
- demonstrates how to use:
No preparation is required unless you want to use a bot account. If you want to use a bot account, follow the instructions below.
- Create a bot account on GitHub.
- Add the bot account to the repository as a collaborator.
- Create the bot account's personal access token that has full access to repo.
- Add the token to GitHub Secrets as
DANGER_GITHUB_API_TOKEN
.
- Copy your Firebase Project ID from Firebase Console, and add it to GitHub Secrets as
FIREBASE_PROJECT_ID
. - Create a service account with an
Editor
role at https://console.developers.google.com/iam-admin/serviceaccounts - Download a private key for the service account as JSON.
- Encode it in Base64 in your favorite way. For example:
cat <private-key>.json | base64
- Add the encoded string to GitHub Secrets as
SERVICE_ACCOUNT_KEY_BASE64
.
- Copy your Firebase app ID from Firebase Console, and add it to GitHub Secrets as
FIREBASE_APP_ID
. - Install Firebase CLI on your computer.
- Run
firebase login:ci
on Terminal/Console, and a Firebase token will be printed. - Add the token to GitHub Secrets as
FIREBASE_TOKEN
.
- Go to https://slack.com/apps/A0F7XDUAZ-incoming-webhooks
- Add Incoming Webhooks
Integration Settings
>Post to Channel
> (select a channel)- Copy
Webhook URL
. - Paste it in GitHub Secrets. I name it
SLACK_WEBHOOK_URL
.
- Download
google-services.json
from Firebase Console. - Copy the raw content (without being encoded in Base64) to GitHub Secrets as, let's say,
GOOGLE_SERVICES_JSON
. - Add the following to your workflow.
- run: echo $GOOGLE_SERVICES_JSON > app/google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}