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] Commenting on PR step not running when triggered from issue_comment #228

Open gabricc opened 2 years ago

gabricc commented 2 years ago

Hey guys!

The Commenting on PR step is not running when the workflow is triggered from issue_comment trigger. It works fine when a PR is opened, all steps are running. But if I changes something in the PR and comments on it to trigger the workflow again, everything runs, except the Commenting on PR step.

Workflow file:

---
name: Crete Storybook preview per PR
on:
  pull_request:
    types:
      - opened
  issue_comment:
    types:
      - created

jobs:
  build_and_preview:
    if: |
      github.event.pull_request.head.repo.full_name == github.repository || contains(github.event.comment.body, 'update_preview_environment')
    runs-on: ubuntu-latest

    env:
      NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    steps:
      - name: Get branch name
        id: branch-name
        uses: tj-actions/branch-names@v5.4

      - name: Checking out to ${{ steps.branch-name.outputs.current_branch }}
        uses: actions/checkout@v3
        with:
          ref: ${{ steps.branch-name.outputs.current_branch }}

      - name: Setup Node
        uses: actions/setup-node@v2
        with:
          node-version: '16'

      - name: Install dependencies
        run: yarn install

      - name: Build Storybook
        run: yarn storybook:build

      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_SLANG_AUTH }}'
          projectId: slang-auth
          channelId: storybook-preview

Error message

There is no error message.

Expected behavior

This is the expected behavior: image

Actual behavior

This is what happens: image

PsiKai commented 1 year ago

I am having the same issue. Using the PR labeled event is working for me, but when using the issue_comment event the action is not being triggered. All other things are equal in my configuration file.

navaneeth-spotnana commented 1 year ago

@PsiKai were you able to get around this?