FirebaseExtended / action-hosting-deploy

Automatically deploy shareable previews for your Firebase Hosting sites
https://firebase.google.com/docs/hosting/github-integration
Apache License 2.0
695 stars 202 forks source link

Only one preview url is generated for multisite #143

Open nwaughachukwuma opened 3 years ago

nwaughachukwuma commented 3 years ago

With 2 workflow.yml files, each one meant to deploy to a hosting channel for a site on a firebase project, only one comment post with deploy preview url is possible on the pull_request. Also, the preview url of the workflow that finishes last overwrites that posted by the first one.

# workflow 1
- uses: FirebaseExtended/action-hosting-deploy@v0
  with:
      repoToken: '${{ secrets.GITHUB_TOKEN }}'
      firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
      projectId: '${{ secrets.PROJECT_ID }}'
      channelId: '${{ gitHub.sha }}-c1'
      target: TARGET_NAME_1
# workflow 2
- uses: FirebaseExtended/action-hosting-deploy@v0
  with:
      repoToken: '${{ secrets.GITHUB_TOKEN }}'
      firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
      projectId: '${{ secrets.PROJECT_ID }}'
      channelId: '${{ gitHub.sha }}-c2'
      target: TARGET_NAME_2
tcrwt commented 3 years ago

I think this was fixed in #52, which was merged in 8e03296fa6512f4b53ad6c39ddcfbe34d7104d4e.

That isn't included in the latest release, v0, which is instead at commit 276388dd6c2cde23455b30293105cc866c22282d.

To fix this, we explicitly use the github action at the latest commit to main, which at time of writing is 0f248036885ae672f78587669fa2923f0ef6cac2:

-    uses: FirebaseExtended/action-hosting-deploy@v0
+    uses: FirebaseExtended/action-hosting-deploy@0f248036885ae672f78587669fa2923f0ef6cac2

You'll know you're on the new version if the bot comments include the Sign: line at the bottom:

image

For us, two separate workflows now produce two separate comments 🎉

(I suppose a longer-term fix would be to update v0 to point at a newer commit on main, but I'm not familiar with that process)