node.js - Firebase 功能部署:带有 Github 操作的未定义环境数据
问题描述
我正在尝试设置 GITHUB 操作来部署我的 firebase 功能。动作的代码是:
name: Development Deploy Workflow
'on':
push:
branches:
- develop
jobs:
backend-deployment:
name: Backend Development Deployment
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub repository
uses: actions/checkout@v2
- name: Install dependencies
run: npm install
- name: Deploy to Firebase Functions
uses: w9jds/firebase-action@master
with:
args: deploy -P development --only functions
env:
GCP_SA_KEY: '${{ secrets.GCP_SA_KEY }}'
当操作运行时,我收到此错误:
✔ functions: Finished running predeploy script.
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔ functions: required API cloudbuild.googleapis.com is enabled
✔ functions: required API cloudfunctions.googleapis.com is enabled
Error: Error occurred while parsing your function triggers.
TypeError: Cannot read property 'private_key' of undefined
at Object.<anonymous> (/github/workspace/lib/services/Firebase.service.js:29:47)
代码行是:
const { private_key } = functions.config().service_account
我不明白为什么functions.config() 是空的,因为我可以毫无问题地从本地机器部署我的函数,并且在三个不同的环境中。谁能帮我?提前致谢。
解决方案
推荐阅读
- python - BeautifulSoup 测试对象类型
- angular - Angular - SpringBoot - CORS(未知 url):0 未知错误
- url - Readiness 和 Liveness Probe Endpoints 的 URL 应该是什么?
- java - 在 Jenkins 中运行 maven 时出现 ClassNotFoundException
- ios - 如何在选择时为 UICollectionViewCell 内容的扩展设置动画?
- javascript - 如何从工具栏拖放 mxGraph 中的自定义图像
- oracle - ACL error when trying to send mail via Oracle UTL_SMTP
- r - 将 R 中 geom_label_repel 中的“a”更改为其他内容,而不仅仅是删除它
- visual-studio-code - Visual Studio 代码版本:1:30.0 - 如何将终端输出移动到底部
- formatting - 如何在代码突出显示中为 Redmine markdown 添加换行符?