action-hosting-deploy icon indicating copy to clipboard operation
action-hosting-deploy copied to clipboard

fix: empty channelId in test environment

Open wneel opened this issue 1 year ago • 0 comments

Hi,

I figured out that the problem I was having in https://github.com/FirebaseExtended/action-hosting-deploy/issues/403 was occurring because I was using act. But i then saw that there is no default case in the getChannelId function.

By adding this else statement, I'm ensuring that the channelId has a valid value before passing it to firebase-tools, otherwise errors will occur and it's hard to debug.

Now, here is the error I get when not using a channelId in a test environment:

{
  conclusion: 'failure',
  output: {
    title: 'Deploy preview failed',
    summary: 'Error: ChannelId is empty. No branch was found in the current context. Please provide a channelId for test environments.'
  }
}

And of course, according to the guidelines I've run:

npm run format:check

npm run build

npm run test

before opening the PR :)

I'm available for any changes or questions, I hope everything sounds good to you.

wneel avatar Dec 28 '24 00:12 wneel