eidan66
eidan66

Reputation: 79

Deploy to Firebase Hosting on PR faild in github actions

I try to create a live preview with firebase. I wrote yml file and its all the time fails..

# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
'on': pull_request
jobs:
    build_and_preview:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2

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

            - run: npm ci
            - run: npm run build

            - name: Deploy
              uses: FirebaseExtended/action-hosting-deploy@v0
              with:
                  repoToken: '${{ secrets.GITHUB_TOKEN }}'
                  firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_SAIKAI_PRODUCTION }}'
                  projectId: saikai-production

and my error:

Run FirebaseExtended/action-hosting-deploy@v0
/home/runner/work/_actions/FirebaseExtended/action-hosting-deploy/v0/bin/action.min.js:1
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("os")),r=require("fs"),i=e(r),n=e(require("path")),s=e(require("stream")),o=e(require("http")),a=e(require("url")),p=e(require("https")),u=e(require("zlib"));require("net");var c=e(require("tls")),d=e(require("events")),l=e(require("assert")),g=e(require("util")),m=e(require("crypto")),h=e(require("child_process")),y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function b(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},r.exports),r.exports}var _=b(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.toComma

Error: Input required and not supplied: firebaseServiceAccount
    at Object.r.getInput (/home/runner/work/_actions/FirebaseExtended/action-hosting-deploy/v0/bin/action.min.js:1:3939)
    at Object.<anonymous> (/home/runner/work/_actions/FirebaseExtended/action-hosting-deploy/v0/bin/action.min.js:1:297680)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11

You can also see the problem here: https://github.com/Saikai-oyo/Saikai/pull/161/checks?check_run_id=2758311365

Upvotes: 5

Views: 4545

Answers (1)

mirksde
mirksde

Reputation: 71

The problem was described and solved here: https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions.

The Dependabot has no access to the secrets.

Instead of: 'on': pull_request

Use: 'on': pull_request_target

Upvotes: 7

Related Questions