action-hosting-deploy
action-hosting-deploy copied to clipboard
fix: empty channelId in test environment
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.