-
Notifications
You must be signed in to change notification settings - Fork 71
Error thrown running storybook-to-ghpages
as a Github Action
#77
Comments
Note: within the same workflow, I'm setting |
I am seeing the same issue. It works when publishing locally, but get the same error when trying to deploy from GitHub Actions. I have experimented with different permissions on Personal Access Token, but no luck. |
I am seeing the same thing happening... |
@tysonnero @speed-e Found a way to fix it! It seems the Step example: - name: Deploy storybook to Github Pages
run: npm run deploy-storybook -- --ci
env:
GH_TOKEN: MyCompany:${{ secrets.GITHUB_TOKEN }} |
@Bjodol Looks like that did the trick. Can you explain why this is need, and if a PR needs to be opened to fix any issue? |
Of course @tysonnero! This is needed as the github api with token is in the following format: This could be fixed here or in |
nvm seems that you cannot directly reference another environment variable when you set env through
- name: Deploy storybook to Github Pages
run: npm run deploy-storybook -- --ci
env:
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} updated working version based on comments below |
@woozyking try this instead: GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} |
@oanylund this works, thank you! Just curious, where was this documented? can we assume all those reserved |
No problem. I think all default environment variables are in the context aswell. |
In my case, I have a private repo and even using GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} did not work. It would correctly push to gh-pages branch, but it wouldn't trigger a deployment to github pages. I created a PAT on my own account and set it as a secret on the repo. Then I used that PAT secret instead of GITHUB_TOKEN and it was able to push to gh-pages and deploy the static changes to github pages. |
I keep getting
With - name: Deploy to GitHub Pages
run: npm run deploy -- --ci
env:
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} |
Don't use the Github token, use a Personal Access Token |
Actually it turns out that because of a build tool I was using (lerna) the |
The fix comes from this issue: storybook-eol/storybook-deployer#77
Storybook deployer requires [GH_TOKEN] var https://github.com/storybookjs/storybook-deployer#storybook-deployer This [issue](storybook-eol/storybook-deployer#77) reccomend scoping it to the current actor
I'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:
Error from Logs:
The text was updated successfully, but these errors were encountered: