FirebaseExtended / FirebaseExtended/action-hosting-deploy
Cannot read properties of undefined (reading 'expireTime')
- Dominant language
- TypeScript
- Stars
- 809
- Forks
- 232
- PR merge metrics
- No merged PRs in 30d
Description
### Action config
```
- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0.10.0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
projectId: my-awesome-project
expires: 30d
channelId: default
```
### Error message
Output from Github Actions:
```
Deploying to Firebase preview channel default
/usr/local/bin/npx firebase-tools@latest hosting:channel:deploy default --expires 7d --project my-awesome-project --json
npm warn exec The following package was not found and will be installed: firebase-tools@14.15.2
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
***
"status": "success",
"result": ***
***::endgroup::
Error: Cannot read properties of undefined (reading 'expireTime')
***
conclusion: 'failure',
output: ***
title: 'Deploy preview failed',
summary: "Error: Cannot read properties of undefined (reading 'expireTime')"
***
***
```
### Expected behavior
I expect the deployment to pass, since it passes when I manually do the deploy.
### Actual behavior
I get this failure. I think it is related to how firebase-cli v14.15.1 (my current version) responds with the command:
```
firebase hosting:channel:deploy default --expires 7d --project my-awesome-project --json
```
which returns:
```
{
"status": "success",
"result": {}
}
```
but in previous issues like https://github.com/FirebaseExtended/action-hosting-deploy/pull/19, I see the return object has the shape:
```
[command]/opt/hostedtoolcache/node/12.18.3/x64/bin/npx firebase-tools hosting:channel:deploy pr1117-devops_preview-chann --project --json
2020-09-14T15:16:21.8119554Z �[2K�[9999D***
2020-09-14T15:16:21.8120456Z "status": "success",
2020-09-14T15:16:21.8121114Z "result": ***
2020-09-14T15:16:21.8121705Z "": ***
2020-09-14T15:16:21.8123270Z "site": "",
2020-09-14T15:16:21.8123801Z "target": "over",
2020-09-14T15:16:21.8125374Z "url": "",
2020-09-14T15:16:21.8127228Z "expireTime": "2020-09-21T15:16:15.792976521Z"
2020-09-14T15:16:21.8127662Z ***,
2020-09-14T15:16:21.8128008Z "": ***
2020-09-14T15:16:21.8128662Z "site": "",
2020-09-14T15:16:21.8129233Z "target": "godaddy",
2020-09-14T15:16:21.8131101Z "url": "https://.web.app",
2020-09-14T15:16:21.8132773Z "expireTime": "2020-09-21T15:16:15.762875096Z"
2020-09-14T15:16:21.8133180Z ***
2020-09-14T15:16:21.8133480Z ***
2020-09-14T15:16:21.8133794Z ***
```
Contributor guide
Research direction
Start by reproducing the GitHub Action with firebase-tools@14.15.2 and inspect how the hosting:channel:deploy --json response is handled when result is empty. The work is done when a successful response with result {} no longer causes the expireTime error and the deployment completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- firebase, github-actions, typescript
- Domain
- ci-cd, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100