Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On github actions, always "warn Failed to detect the previous snapshot key" #186

Open
hirokiynp opened this issue Feb 20, 2020 · 1 comment

Comments

@hirokiynp
Copy link

on local , reg-suit sync-expected is correctly working.
but, reg-suit sync-expected is not working correctly in github actions.

name: CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js v11
      uses: actions/setup-node@v1
      with:
        node-version: "11.0.0"
    - run: yarn install
    - name: workaround for detached HEAD
      run: |
        git checkout ${GITHUB_REF#refs/heads/} || git checkout -b ${GITHUB_REF#refs/heads/} && git pull
    - name: run reg-suit
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      run: |
        yarn run test-visual 

"run test-visual" call "reg-suit run".

on local

[reg-suit] info Detected the previous snapshot key: 'a7c1b4***************************************'

on github actions

[reg-suit] warn Failed to detect the previous snapshot key
[reg-suit] info Skipped to fetch the expected data because expected key is null.

by this problem, I can't compair images....

please help me.

@sasurau4
Copy link
Contributor

sasurau4 commented Apr 21, 2020

I met same issue and found the cause.

In https://github.com/actions/checkout/tree/v2.1.0#checkout-v2

Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
The actions/checkout@v2 fetch only single SHA and no history.

I confirmed the issue fixed with 2 options. One is set the option fetch-depth: 0. The other is following https://github.com/actions/checkout/tree/v2.1.0#fetch-all-history-for-all-tags-and-branches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants