{"id":20774124,"url":"https://github.com/pchmn/firebase-cli-github-action","last_synced_at":"2026-03-19T17:27:49.750Z","repository":{"id":117650449,"uuid":"585530248","full_name":"pchmn/firebase-cli-github-action","owner":"pchmn","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-07T00:26:38.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T14:40:35.428Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pchmn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-05T12:07:23.000Z","updated_at":"2023-03-10T12:14:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9524a51-d7eb-45c5-842b-879d4f2d6e36","html_url":"https://github.com/pchmn/firebase-cli-github-action","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchmn%2Ffirebase-cli-github-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchmn%2Ffirebase-cli-github-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchmn%2Ffirebase-cli-github-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pchmn%2Ffirebase-cli-github-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pchmn","download_url":"https://codeload.github.com/pchmn/firebase-cli-github-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243112190,"owners_count":20238182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T12:28:26.786Z","updated_at":"2025-12-25T00:41:49.844Z","avatar_url":"https://github.com/pchmn.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firebase CLI Gihtub Action\n\n- Install `firebase-tools` package (you can choose the package manager and the version to use)\n- Authenticate with service account key (recommanded) or firebase token\n- Use specific project\n- Launch the firebase command you want\n\n## Summary\n\n- [Usage](#usage)\n- [Inputs](#inputs)\n- [Advanced Usages](#advanced-usages)\n- [Authentication to firebase CLI](#authentication-to-firebase-cli)\n\n## Usage\n\n\u003e ⚠️ This action install `firebase-tools` npm package, so you have to setup node before using it.\n\n### Simple example\n\n```yaml\n# ...\n\njobs:\n  buildAndDeploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n\n      # You need to setup node before using the action\n      - uses: actions/setup-node@v3\n        with:\n          node-version: 16.x\n          cache: npm\n\n      # Add any steps. For example:\n      # - run: npm ci \u0026\u0026 npm build\n\n      - uses: pchmn/firebase-cli-github-action@main\n        with:\n          serviceAccountKey: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KEY }}\n          projectId: your-projectId\n          args: deploy --only functions\n          # or:\n          # args: deploy --only hosting\n          # args: deploy --only firestore:rules\n```\n\n## Inputs\n\n| Name                | Note                                      | Description                                                                                                |\n| ------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------- |\n| `packager`          | (default to `npm`)                        | The package manager to use to install the CLI.\u003cbr\u003eSee [examples](#use-other-package-manager)               |\n| `version`           | (default to `latest`)                     | The `firebase-tools` version to install                                                                    |\n| `serviceAccountKey` | (required if `token` not set)             | The service account key (JSON format) to use to authenticate with.\u003cbr\u003eSee [instructions](#service-account) |\n| `token`             | (required if `serviceAccountKey` not set) | The firebase token to use to authenticate with.\u003cbr\u003e⚠️ Deprecated, use a service account instead            |\n| `projectId`         |                                           | The project to use                                                                                         |\n| `args`              |                                           | Additional arguments to pass to the CLI.\u003cbr\u003eExample: `deploy --only functions`                             |\n\n## Advanced usages\n\n### Use other package manager\n\n**yarn**:\n\n```yaml\n# ...\n\njobs:\n  jobName:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n\n      - uses: actions/setup-node@v3\n        with:\n          node-version: 16.x\n          cache: yarn\n\n      # ...\n\n      - uses: pchmn/firebase-cli-github-action@main\n        with:\n          packager: yarn\n          # other options\n```\n\n**pnpm**:\n\n```yaml\n# ...\n\njobs:\n  jobName:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n\n      - uses: pnpm/action-setup@v2\n        with:\n          version: 7.x\n\n      - uses: actions/setup-node@v3\n        with:\n          node-version: 16.x\n          cache: pnpm\n\n      # ...\n\n      - uses: pchmn/firebase-cli-github-action@main\n        with:\n          packager: pnpm\n          # other options\n```\n\n### Use firebase command in other step\n\nYou don't have to use `args` option, and you can launch firebase command in other steps after setting up the CLI.\n\n```yaml\n# ...\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n\n      - uses: actions/setup-node@v3\n        with:\n          node-version: 16.x\n          cache: npm\n\n      # ...\n\n      - uses: pchmn/firebase-cli-github-action@main\n        with:\n          # options\n\n      # firebase command is now accessible\n      - run: firebase deploy --only functions\n```\n\n## Authentication to firebase CLI\n\n### Service Account\n\n#### 1. Get a service account for your project (you can create one on [GCP Service Accounts page](https://console.cloud.google.com/iam-admin/serviceaccounts)) with any of these roles according to your needs:\n\n- `Service Account User`: required for CLI deploys\n- `Cloud Functions Admin`: required to deploy functions\n- `Cloud Scheduler Admin`: required to deploy schedulded functions\n- `Firebase Rules Admin`: required to deploy Firestore/Firebase rules\n- `Cloud Datastore Index Admin`: required to deploy Firestore indexes\n- `Firebase Hosting Admin`: required to deploy hosting\n- `Firebase Authentication Admin`: required to add preview URLs to Auth authorized domains\n\n#### 2. Add the service account key to your repository secrets:\n\n- Create and download your service account JSON key (see [here](https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating_service_account_keys))\n- Add the content of JSON file as a secret in your repository (example: `FIREBASE_SERVICE_ACCOUNT_KEY`) and use it as `serviceAccountKey` option:\n\n```yaml\n- uses: pchmn/firebase-cli-github-action@main\n  with:\n    serviceAccountKey: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_KEY }}\n```\n\n### Firebase token\n\n\u003e ⚠️ This authentication method is deprecated, and is not recommanded. You should use a service account key instead\n\nRun `firebase login:ci` in your terminal to get a token. Then add it as a secret in your repository (example: `FIREBASE_TOKEN`) and use it as `token` option:\n\n```yaml\n- uses: pchmn/firebase-cli-github-action@main\n  with:\n    token: ${{ secrets.FIREBASE_TOKEN }}\n```\n\n## License\n\nThis project is released under the [MIT License](https://github.com/pchmn/firebase-cli-github-action/blob/main/license).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpchmn%2Ffirebase-cli-github-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpchmn%2Ffirebase-cli-github-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpchmn%2Ffirebase-cli-github-action/lists"}