Closed amowu closed 4 years ago
I'm seeing this too, and the PERCY_TOKEN
secret is set.
/usr/local/bin/npx percy-storybook
Error: Error: The PERCY_TOKEN environment variable is missing.
at Object._callee$ (/home/runner/work/react-components/react-components/node_modules/@percy/storybook/lib/cli.js:84:19)
at tryCatch (/home/runner/work/react-components/react-components/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/home/runner/work/react-components/react-components/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.<computed> [as next] (/home/runner/work/react-components/react-components/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/home/runner/work/react-components/react-components/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /home/runner/work/react-components/react-components/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
at new Promise (<anonymous>)
at new F (/home/runner/work/react-components/react-components/node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js:36:28)
at Object.<anonymous> (/home/runner/work/react-components/react-components/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12)
at Object.run (/home/runner/work/react-components/react-components/node_modules/@percy/storybook/lib/cli.js:143:17)
at Object.<anonymous> (/home/runner/work/react-components/react-components/node_modules/@percy/storybook/bin/percy-storybook.js:4:4)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at /usr/local/lib/node_modules/npm/node_modules/libnpx/index.js:268:14
##[error]The process '/usr/local/bin/npx' failed with exit code 1
Weirdly, we had one PR pass without issue, but subsequent PRs are now failing with this.
I suspect this is due to the PR coming from a forked repository. Any suggestions for working around this, or is this a fundamental limitation of github actions currently?
Relevant discussion here. For the meantime we've amended our yaml to:
on: [push]
A shame that we can't gate PRs on percy.
Ah, right, that would do it! Currently there's no way to expose secrets to forks for GitHub actions. If that's something that's required you'd have to switch to something like CircleCI until GitHub implements it.
@amowu were you also having the same issue (the token missing on forked PR builds)? If so I'll rename the issue title (for future search ability) and then close out 👍
I have added
PERCY_TOKEN
to the GitHub repo Settings > Secrets.But I got a wrong results:
This is my config file: