Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate GitHub Action Messages for Different Preview URLs #384

Open
devj3ns opened this issue Jul 10, 2024 · 0 comments
Open

Separate GitHub Action Messages for Different Preview URLs #384

devj3ns opened this issue Jul 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@devj3ns
Copy link

devj3ns commented Jul 10, 2024

Describe the bug
When deploying multiple preview channels (e.g., development and production) within a single GitHub Actions workflow, the bot currently updates a single comment in the PR conversation. Initially, it posts the production URL and then edits the same comment to include the development URL. This can be confusing and leads to a less clear separation of information.

Expected behavior
The ideal behavior would be for the bot to create separate comments for each preview URL. This ensures clarity and improves the PR review process by distinctly separating the URLs for different environments (e.g., development and production).

Steps to reproduce

  1. Set up a GitHub Actions workflow to deploy both development and production versions of an application using FirebaseExtended/action-hosting-deploy.
  2. Trigger the workflow on a pull request.
  3. Observe that the bot updates a single comment with both URLs, rather than creating separate comments for each URL.
  4. Proposed solution
  5. Modify the action to create separate comments for each deployment when multiple preview channels are deployed within the same workflow. This would enhance the readability and organization of the PR conversation, especially in complex projects with multiple environments.

Example workflow snippet

deploy_dev:
  name: "Deploy DEV"
  runs-on: ubuntu-latest
  needs: build_dev
  steps:
    - name: 📚 Checkout repo
      uses: actions/checkout@v4

    - name: ⬇️ Download Development Artifact
      uses: actions/download-artifact@master
      with:
        name: build-dev
        path: build/web

    - name: 🎯 Deploy to firebase (Preview - DEV)
      uses: FirebaseExtended/action-hosting-deploy@v0
      with:
        repoToken: "${{ secrets.GITHUB_TOKEN }}"
        firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
        projectId: my-project-id
        channelId: dev-${{ github.event.pull_request.number }}
        expires: 30d

deploy_prod:
  name: "Deploy PROD"
  runs-on: ubuntu-latest
  needs: build_prod
  steps:
    - name: 📚 Checkout repo
      uses: actions/checkout@v4

    - name: ⬇️ Download Production Artifact
      uses: actions/download-artifact@master
      with:
        name: build-prod
        path: build/web

    - name: 🎯 Deploy to firebase (Preview - PROD)
      uses: FirebaseExtended/action-hosting-deploy@v0
      with:
        repoToken: "${{ secrets.GITHUB_TOKEN }}"
        firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
        projectId: my-project-id
        channelId: prod-${{ github.event.pull_request.number }}
        expires: 30d
@devj3ns devj3ns added the enhancement New feature or request label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant