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] preview hosts are not being added to the authorized domains list #347

Open
rosostolato opened this issue Feb 29, 2024 · 6 comments
Open
Labels
bug Something isn't working

Comments

@rosostolato
Copy link

I always used this action to deploy preview links for my PRs. But, recently, the google authenticator stopped working for my app because the preview domain isn't being added to the "authorized domains" list anymore.

I don't know if this is Firebase or this action plugin fault.

Action config

- uses: FirebaseExtended/action-hosting-deploy@v0
  with:
    repoToken: "${{ secrets.GITHUB_TOKEN }}"
    firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
    expires: 30d
    projectId: my-awesome-project

Error message

No errors. It deploys successfully.

Expected behavior

Expected to have the new preview URL domain added to the firebase authorized domains.

Actual behavior

The preview link is created, posted to the PR comments but the domain is not added to the authorized domains, causing google auth to not work on the preview link.

@rosostolato rosostolato added the bug Something isn't working label Feb 29, 2024
@weilinzung
Copy link
Contributor

weilinzung commented Feb 29, 2024

It seems something on Google's side, but hard to tell from this action extension.

https://stackoverflow.com/a/64468339/8543478 from this, possible to catch the error?

Firebase tool source code: https://github.com/firebase/firebase-tools/blob/06220c3b9912099eefbaa6e0a4dfd46d2e58aa2a/src/commands/hosting-channel-deploy.ts#L200-L224

@skynetigor
Copy link

We also have this issue last couple of days. As a workaround, we manually add preview domains to authorized domains in Firebase console.

@michaelk-kipnis
Copy link

Any news regarding this issue? We are clueless and need assistance..

@weilinzung
Copy link
Contributor

weilinzung commented Mar 3, 2024

Someone created the issue over firebase tool already: firebase/firebase-tools#6828

We are using "firebase-tools": "12.8.1"` in our NX repo but the action is trying to install the latest version as default.

  npm WARN exec The following package was not found and will be installed: [email protected]

As a workaround, we set the Firebase tool version to 12.8.1 that has no this issue for our case: #246

https://github.com/FirebaseExtended/action-hosting-deploy?tab=readme-ov-file#firebasetoolsversion-string

firebaseToolsVersion {string}
The version of firebase-tools to use. If not specified, defaults to latest.



jobs:
  build_and_preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      # Add any build steps here. For example:
      # - run: npm ci && npm run build
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: xxx
          firebaseServiceAccount: xxx
          projectId: xxx
          firebaseToolsVersion: v12.8.1 => here

@schankam
Copy link

Same issue here.

I checked the service account used and it has the correct Firebase Authentication Admin permission. When I run the command locally on my machine, it work as expected and add the preview channel domain to the list of authorised domains.

It just does not work in the CI, how can we unlock this situation? We're blocked cause preview channel are basically useless if we can't login on them.

@rosostolato
Copy link
Author

@schankam this solutions worked for me firebase/firebase-tools#6828 (comment)

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

5 participants