FirebaseExtended / FirebaseExtended/action-hosting-deploy

Workflow inputs to dynamically deploy to channel

Open
#227 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
809
Forks
232
PR merge metrics
No merged PRs in 30d

Description

### The use case you're trying to solve

I'm building a a workflow where maintainer can select the channel they want the app is published into. For example, `live`, `staging` (long-lived preview), and `‎` (new preview)

![image](https://user-images.githubusercontent.com/60868965/184100591-55b6a885-f884-41a3-b646-a8d6b64e4b6d.png)

```yaml
name: Deploy to Firebase Hosting
"on":
workflow_dispatch:
inputs:
deployChannel:
description: "Channel which Firebase will deploy into"
default: ""
type: choice
options:
- live
- staging
-

... some actions

- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0
id: firebaseHost
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.SOME_SECRETS }}"
channelId: ${{ inputs.deployChannel }} # value from the input above
projectId: someprojectid
```

If I understand from the docs, the deploy to a new preview channel, just leave the `channelId` property empty. I tried to achive that by passing an empty value.

However, on clicking **Run workflow**. GitHub immediately crashed, seems like it didn't support empty value?

![image](https://user-images.githubusercontent.com/60868965/184102286-1a12eb41-6939-4bfb-a315-5a714df6f1b5.png)

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by reproducing the workflow_dispatch form with an empty choice and trace how deployChannel reaches the Firebase Hosting deploy action; done means selecting the empty option no longer crashes Run workflow and deploys to a new preview channel.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.