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
704 stars 202 forks source link

[BUG] Only one comment is posted by the bot in case of multiple deployment workflows #229

Open wujekbogdan opened 2 years ago

wujekbogdan commented 2 years ago

Action config

I have 2 workflows:

One for "regular" PR previews

name: Deploy to Firebase Hosting on PR

on: [pull_request]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build_and_preview:
    if: ${{ !github.event.pull_request.draft }}
    name: Build the app and deploy to Firebase Hosting (PR preview)
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Build
        uses: ./.github/actions/init
        with:
          command: npm run build:development
          NPM_TOKEN: ${{secrets.NPM_TOKEN}}

      - name: Deploy
        uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          expires: 30d
          channelId: PR-${{ github.event.number }}
          repoToken: ${{ secrets.GITHUB_TOKEN }}
          firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CM_DEV_D0EC1 }}
          projectId: MY_PROJECT_ID

One for RC PR previews

name: Deploy to Firebase Hosting on RC PR

on:
  pull_request:
    branches:
      - master

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build_and_preview:
    if: ( ${{ !github.event.pull_request.draft }} ) && ( ${{contains(github.event.pull_request.title, 'RC')}} )
    name: Build the app and deploy to Firebase Hosting (RC)
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Build
        uses: ./.github/actions/init
        with:
          command: npm run build:production
          NPM_TOKEN: ${{secrets.NPM_TOKEN}}

      - name: Deploy
        uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          expires: 30d
          channelId: RC-${{ github.event.number }}
          repoToken: ${{ secrets.GITHUB_TOKEN }}
          firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CM_PROD_C42CC }}
          projectId: MY_PROJECT_ID

Error message

There's no error message

Expected behavior

If both actions run then I would expect the bot to post 2 comments with the PR preview link.

Actual behavior

There's only one comment posted.

joelheadley commented 1 year ago

Did you find a work around to this issue?