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

How do you use this action in a folder not in the root directory? #18

Closed
ChadTaljaardt opened this issue Jan 31, 2020 · 3 comments · Fixed by #19
Closed

How do you use this action in a folder not in the root directory? #18

ChadTaljaardt opened this issue Jan 31, 2020 · 3 comments · Fixed by #19

Comments

@ChadTaljaardt
Copy link

Hello,

I am new to working with Github actions.

I am trying to run this action on a "user_interface" sub directory, can anyone explain to me how to do this?

Thanks!

@jiro4989
Copy link

jiro4989 commented Feb 1, 2020

@ChadTaljaardt

  1. Please try to put this YAML file to .github/workflows/reviewdog.yml .
name: reviewdog
on: [pull_request]
jobs:
  eslint:
    name: runner / eslint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: eslint
        uses: reviewdog/action-eslint@v1
        with:
          github_token: ${{ secrets.github_token }}
          reporter: github-pr-review # Change reporter.
          eslint_flags: 'user_interface/' # <-- Target source directory
  1. Create a new branch
  2. Add your source code
  3. Create a pull request
  4. See pull request, or github actions (https://github.com/<your_name>/<your_repo>/actions)

See also:

@ChadTaljaardt
Copy link
Author

@jiro4989 Thanks for your response, i already tried to do what you suggested. This is the error i'm getting which i think is caused because the command isn't being run in the user_interface folder.

npm WARN saveError ENOENT: no such file or directory, open '/github/workspace/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/github/workspace/package.json'
npm WARN workspace No description
npm WARN workspace No repository field.
npm WARN workspace No README data
npm WARN workspace No license field.

up to date in 0.561s
found 0 vulnerabilities

/entrypoint.sh: line 11: /github/workspace/node_modules/.bin/eslint: not found
/entrypoint.sh: line 15: /github/workspace/node_modules/.bin/eslint: not found

@LaurenceGA
Copy link

Having the same issue.
The script goes in GITHUB_WORKSPACE, then starts running the commands from there.
It looks for eslint in this folder here.
eslint_flags isn't used until eslint is actually run, but it needs to find eslint in the right directory before it can run it...

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

Successfully merging a pull request may close this issue.

3 participants