percy / exec-action

A (deprecated) GitHub action to run Percy Agent `percy exec` commands
https://docs.percy.io/docs/github-actions#section-exec-action
MIT License
8 stars 5 forks source link

Very little info on how to migrate to Percy CLI #29

Closed SimonDanisch closed 2 years ago

SimonDanisch commented 3 years ago

From the readme:

⚠️ This action is only required if you're using an older SDK not using Percy CLI. In Percy CLI, GitHub actions will work out of the box.

From the docs:

Now you can run your tests with Percy (typically percy exec -- [test command]) and send builds to Percy from CI.

So from that I take, I shouldn't be using this anymore:

- name: Percy Upload
        uses: percy/exec-action@v0.3.1
        with:
          custom-command: "npx percy upload ./images"
        env:
          PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

But it doesn't really say what I should do instead... From the docs I take I understand I can just do something like:

- name: Percy Upload
        run: percy upload ./images
        env:
          PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

But that doesn't work... So what's the snippet I should use these days for the newest Percy CLI?

Robdel12 commented 3 years ago

👋🏼 Hey @SimonDanisch! These actions were only ever needed to set 2-3 env vars. In Percy CLI we do what the actions runner does and read the env vars from a file -- eliminating the need for custom JS actions now.

But that doesn't work...

Can you share how it doesn't work? I'm going to guess you need something like npx to get the location of the percy CLI binary (npx is a short hand for something like: /node_modules/.bin/percy upload ...)

Edit: Also, here's a doc for CLI migration: https://docs.percy.io/docs/migrating-to-percy-cli (for SDK migration)