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

Which files are required to make this work "in someone's own repo"? #21

Closed Pomax closed 3 years ago

Pomax commented 3 years ago

Due to business requirements, some repos can only run github-sanctioned or even only local actions: which files are required in order to make this action work by placing it in a repo's own .github/actions/ dir?

(and ideally, can that information be added as a README.md section, to have that knowledge concisely available in a single, obvious place =)

Robdel12 commented 3 years ago

Hey @Pomax! I'm not quite sure I understand what you're looking for. Are you looking to clone this repos source into your own repo and then use it that way? If so, you could clone the repo and then provide a path (kind of like this: https://github.com/percy/exec-action/blob/master/.github/workflows/pr.yml#L12)

Pomax commented 3 years ago

No, just looking to copy only exactly the files needed into the ./github/actions dir. After some digging, it turns out this just needs to be the action.yml file and the dist/index.js, so we have the following dir structure now:

+ .github
|   + workflows
|   + actions
|   |   + percy-exec
|   |      + action.yml
|   |      + index.js
.   . 

with action.yml updated to point to ./index.js instead of the dist dir, and our CI yml updated to say:

...
    - name: Percy Test
      uses: ./.github/actions/percy-exec
      with:
        command: "npm run cypress:ci"
      env:
        PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
Robdel12 commented 3 years ago

Gotcha! Sounds like you worked it out :)

Pomax commented 3 years ago

I did, but that doesn't mean it's ready to close this issue: adding that info to the README.md is going to help folks =)