feat(totalPreviewChannelLimit): add option to manage preview channels to avoid hitting the channel quota #400
+435
−33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of the solution for #60
Also, the existing "pre-commit" hooks don't work, I made improvements and fixed the issueWhat’s Changed:
Added
totalPreviewChannelLimit
Input Option:action.yml
,README.md
totalPreviewChannelLimit
, you can avoid hitting the hosting quota limit (currently set at 50 channels).Once the limit is reached, older preview channels are automatically removed, preventing errors like "channel quota reached."
New Function for Managing Preview Channels:
src/deploy.ts
getAllChannels
function to list all active preview channels in the Firebase project, making it easier to track the quota.removePreviews
, which removes older preview channels when thetotalPreviewChannelLimit
is reached. It uses theremoveChannel
function to delete specific channels.removeChannel
function allows the deletion of specific preview channels by their ID, helping manage the number of active channels.Docs Updates:
README.md
,action.yml
totalPreviewChannelLimit
option, explaining how to set it up and how it interacts with Firebase Hosting’s limits.Why This Matters:
This change aims to give you more control over Firebase Hosting preview channels. Now, you can prevent hitting the 50-channel limit by automatically cleaning up older channels when necessary, saving you from unexpected errors in your deployment process.