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

Folders are creates as root #344

Open
Maxim-Mazurok opened this issue Dec 26, 2023 · 2 comments
Open

Folders are creates as root #344

Maxim-Mazurok opened this issue Dec 26, 2023 · 2 comments

Comments

@Maxim-Mazurok
Copy link

Maxim-Mazurok commented Dec 26, 2023

Bug description

I have followed this recipe: https://docs.lost-pixel.com/user-docs/recipes/lost-pixel-oss/automatic-baseline-update-pr

However, folders are create as root and I'm running into this issue: peter-evans/create-pull-request#783

This fixes the problem: sudo chown -R $USER:$USER .lostpixel, just make sure to run it on failure as well

Run ls -alrth .lostpixel
total 2[4](https://github.com/Maxim-Mazurok/maxim.mazurok.com/actions/runs/7328008717/job/19955652396#step:10:5)K
-rw-r--r--  1 runner docker   19 Dec 26 08:34 .gitignore
drwxr-xr-x 1[5](https://github.com/Maxim-Mazurok/maxim.mazurok.com/actions/runs/7328008717/job/19955652396#step:10:6) runner docker 4.0K Dec 2[6](https://github.com/Maxim-Mazurok/maxim.mazurok.com/actions/runs/7328008717/job/19955652396#step:10:7) 0[8](https://github.com/Maxim-Mazurok/maxim.mazurok.com/actions/runs/7328008717/job/19955652396#step:10:9):35 ..
drwxr-xr-x  2 root   root   4.0K Dec 26 08:35 difference
drwxr-xr-x  5 runner docker 4.0K Dec 26 08:35 .
drwxr-xr-x  3 root   root   4.0K Dec 26 08:35 current
drwxr-xr-x  3 root   root   4.0K Dec 26 08:35 baseline
0s
Run sudo chown -R $USER:$USER .lostpixel
0s
Run ls -alrth .lostpixel
total 24K
-rw-r--r--  1 runner runner   1[9](https://github.com/Maxim-Mazurok/maxim.mazurok.com/actions/runs/7328008717/job/19955652396#step:10:10) Dec 26 08:34 .gitignore
drwxr-xr-x [1](https://github.com/Maxim-Mazurok/maxim.mazurok.com/actions/runs/7328008717/job/19955652396#step:11:1)5 runner docker [4](https://github.com/Maxim-Mazurok/maxim.mazurok.com/actions/runs/7328008717/job/19955652396#step:12:5).0K Dec 26 08:3[5](https://github.com/Maxim-Mazurok/maxim.mazurok.com/actions/runs/7328008717/job/19955652396#step:12:6) ..
drwxr-xr-x  2 runner runner 4.0K Dec 2[6](https://github.com/Maxim-Mazurok/maxim.mazurok.com/actions/runs/7328008717/job/19955652396#step:12:7) 0[8](https://github.com/Maxim-Mazurok/maxim.mazurok.com/actions/runs/7328008717/job/19955652396#step:12:9):35 difference
drwxr-xr-x  5 runner runner 4.0K Dec 26 08:35 .
drwxr-xr-x  3 runner runner 4.0K Dec 26 08:35 current
drwxr-xr-x  3 runner runner 4.0K Dec 26 08:35 baseline

How to reproduce

on: workflow_dispatch

jobs:
  lost-pixel-update:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Use Node.js
        uses: actions/setup-node@v3
        with:
          node-version-file: '.nvmrc'
          cache: 'npm'

      - name: Install NPM dependencies
        run: npm ci

      - name: Build
        run: npm run compile

      - name: Serve
        run: npm run start-dev &

      - name: Wait for server to start
        run: sleep 5

      - name: Lost Pixel
        id: lp
        uses: lost-pixel/lost-pixel@v3.8.2
        env:
          LOST_PIXEL_MODE: update

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v5
        if: ${{ failure() && steps.lp.conclusion == 'failure' }}
        with:
          token: ${{ secrets.GH_TOKEN }}
          commit-message: update lost-pixel baselines
          delete-branch: true
          branch: 'lost-pixel-update/${{ github.ref_name }}'
          title: 'Lost Pixel update - ${{ github.ref_name }}'
          body: Automated baseline update PR created by Lost Pixel

Using this on a repo with no .lostpixel folder

Expected behavior

No response

Lost Pixel information

lost-pixel logs from CI

No response

@d-ivashchuk
Copy link
Collaborator

Alternative you can now also update the images locally while running lost-pixel on docker.

npx lost-pixel docker update

it's a fresh feature so it does not have full page mode support so you might need to tinker your pagesUrl with host.docker.internal to make sure your app is accessible by lost pixel outside of it docker container

@Maxim-Mazurok
Copy link
Author

I don't think this will help as I'm running into this issue in GHA, not locally

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