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

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

Open
Glenn-Terjesen opened this issue Aug 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Glenn-Terjesen
Copy link

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

@Glenn-Terjesen Glenn-Terjesen added the bug Something isn't working label Aug 29, 2024
@Glenn-Terjesen
Copy link
Author

Just saw this: #302
If that's merged, my problem will probably be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant