Channel ID from Commit
Currently have it setup that PR onto the dev or main branch trigger deployment of a preview, but would be great if a preview deployment could be triggered on a merge - Currently no channel id gets generated in this case resulting in an error and a failed action because no channel id is supplied
The sha or subject of the commit on a push could be used to generate the channel Id instead, allowing for this use case
is there workaround?
my workaround was to manually specify the channelId, loosely based on the current code: https://github.com/FirebaseExtended/action-hosting-deploy/blob/main/bin/action.min.js#L11267
- name: Deploy to Firebase (preview)
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
expires: 3d
projectId: my-project-id
channelId: 'pr-${{ github.event.number }}-${{ github.event.pull_request.head.ref }}'
I get a warning about unsupported characters (/), but the script replaces them with _ so it should be good as a temporary workaround.
Any constant channel ID can be provided in channelId key, e.g. preview. It need not be unique as Firebase appends a random hash to the channel ID while generating preview URL (Documentation link)
None of these 'solutions' work.
I use instead https://github.com/w9jds/firebase-action that covers similar functionality and has simpler usage.