Error thrown running `storybook-to-ghpages` as a Github Action
See original GitHub issueI’m running the following npm script from a Github Action:
"deploy-storybook": "storybook-to-ghpages -p packages -o=storybook-static --ci"
When npm run deploy-storybook
is executed locally, it runs successfully.
When run as part of my Github Action, it fails with a generic error message. Running build-storybook
from CI has no issue.
Step:
- name: Deploy to GH Pages
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: npm run deploy-storybook
Error from Logs:
=> Deploying storybook
executing: git push --force --quiet https://***@github.com/org/repo master:gh-pages
/home/runner/work/petra/petra/node_modules/@storybook/storybook-deployer/src/utils.js:14
throw new Error(
^
Error: Exec code(128) on executing: git push --force --quiet https://***@github.com/org/repo master:gh-pages
undefined
at Object.exec (/home/runner/work/petra/petra/node_modules/@storybook/storybook-deployer/src/utils.js:14:9)
at Object.<anonymous> (/home/runner/work/petra/petra/node_modules/@storybook/storybook-deployer/bin/storybook_to_ghpages:69:14)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
at internal/main/run_main_module.js:17:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Issues · storybookjs/storybook-deployer - GitHub
Error thrown running storybook-to-ghpages as a Github Action. #77 opened on Jan 27, ... Error when run yarn deploy-storybook --ci in CircleCi.
Read more >Setting exit codes for actions - GitHub Docs
You can use exit codes to set the status of an action. ... GitHub uses the exit code to set the action's check...
Read more >Github Actions UI highlights errors where it finds "[error]" #12623
I would consider this a bug, because I would expect the source code section (dropdown run section) not to be highlighted.
Read more >Workflow commands for GitHub Actions
Stops processing any workflow commands. This special command allows you to log anything without accidentally running a workflow command. For example, you could ......
Read more >Workflow syntax for GitHub Actions
Example: Using PowerShell Desktop to run a script. Example: Running a python script. Custom shell. Exit codes and error action preference. jobs.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tysonnero @speed-e Found a way to fix it! It seems the
--ci
option doesn’t include github actors in the git url. Simply replace your token line with the the following.GH_TOKEN: MyCompany:${{ secrets.GITHUB_TOKEN }}
.Step example:
nvm seems that you cannot directly reference another environment variable when you set env through
env:
in github actionsthis can be further improved through the providedGITHUB_ACTOR
env varupdated working version based on comments below