Skip to content

[BUG] details_url / urls output is not set when deploying with channelId: live #388

Open
@Glenn-Terjesen

Description

@Glenn-Terjesen

Hi!
Ref: https://github.com/FirebaseExtended/action-hosting-deploy/tree/v0/?tab=readme-ov-file#details_url
Seems the Github Actions output is only set when deploying a preview channel.

Action config

   - id: firebase-deploy
        uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          firebaseServiceAccount: "${{ env.SERVICE_ACCOUNT_KEY }}"
          projectId: ${{ inputs.gcp_project_id }}
          entryPoint: ${{ inputs.entry_point }}
          channelId: live

      - name: Add comment with the web url
        if: github.event_name == 'pull_request'
        uses: actions/github-script@v7
        env:
          MESSAGE_BODY: "The firebase hosting site in ${{ inputs.environment }} is available at ${{ steps.firebase-deploy.outputs.details_url }}"
          ALL_URLS: ${{ steps.firebase-deploy.outputs.urls }}
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            await github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: process.env.MESSAGE_BODY
            });  
{
    details_url: 'https://xyz.web.app/',
    conclusion: 'success',
    output: {
      title: 'Production deploy succeeded',
      summary: '[xyz.web.app](https://xyz-full.web.app/)'
    }
  }

Error message

Result:
"MESSAGE_BODY: The firebase hosting site in dev is available at "

  • Missing the details_url output string.

Expected behavior

Expected it to work for both preview and live.

Actual behavior

This works:

- id: firebase-deploy-preview
        uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          firebaseServiceAccount: "${{ env.SERVICE_ACCOUNT_KEY }}"
          projectId: ${{ inputs.gcp_project_id }}
          entryPoint: ${{ inputs.entry_point }}
          expires: ${{ inputs.preview_expire }}

      - name: Add comment with preview url
        if: github.event_name == 'pull_request'
        uses: actions/github-script@v7
        env:
          MESSAGE_BODY: "Preview for this PR in ${{ inputs.environment }} is available at ${{ steps.firebase-deploy-preview.outputs.details_url }}"
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            await github.rest.issues.createComment({
              issue_number: context.issue.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              body: process.env.MESSAGE_BODY
            });

the steps.firebase-deploy-preview.outputs.details_url gets populated :-)

Thanks for reading this far

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions