Closed erik-inkapool closed 4 years ago
Hey @erik-inkapool! This one is a weird one that we haven't been able to figure out. Seemingly (for unknown reasons) Bitbucket pipelines will return the shortened SHA for: https://github.com/percy/percy-js/blob/master/src/environment.js#L217
In these cases you will have to manually set PERCY_COMMIT
to the full 40 char SHA. I think this will work: PERCY_COMMIT=$(git rev-parse HEAD)
Hi @Robdel12! Thanks for the quick response. Your solution worked perfectly, this is what the pipeline looks like now:
image: circleci/node:10.22.1-browsers
pipelines:
pull-requests:
'**':
- step:
caches:
- npm
script:
- npm ci
- npm run-script build:storybook # build-storybook
- PERCY_COMMIT=$(git rev-parse HEAD) npm run-script test:visual # percy-storybook --widths=320,1280
definitions:
caches:
npm: $HOME/.npm
Getting error message
In pull requests, but the same pipeline will run fine when triggered manually or by commit. My use case is that I would like to only run percy on the main branch and on PRs to that branch, not on individual feature branch commits or the like.
My pipeline uses the pull-requests build variant, like so:
I can work around the problem by using a configuration that always builds every commit: