tsuyoshicho / action-textlint

Run textlint with reviewdog on pull requests to improve document writing experience.
Creative Commons Zero v1.0 Universal
68 stars 6 forks source link

Github Action fails #37

Closed svenmueller closed 4 years ago

svenmueller commented 4 years ago

Hi,

I tried the following example configuration from the README.md

name: reviewdog
on: [pull_request]
jobs:
  textlint:
    name: runner / textlint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
        with:
          submodules: true
      - name: textlint-github-pr-review
        uses: tsuyoshicho/action-textlint@v1
        with:
          github_token: ${{ secrets.github_token }}
          reporter: github-pr-review

The github action action fails with:

/usr/bin/docker run --name yxz --label 430c1a --workdir /github/workspace --rm -e INPUT_GITHUB_TOKEN -e INPUT_REPORTER -e INPUT_LEVEL -e INPUT_TEXTLINT_FLAGS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/k8s-manifests/k8s-manifests":"/github/workspace" 430c1a:c6d9dff969014135bcaebd57d1067df8  "***" "error" "github-pr-review" "."
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.525s
found 0 vulnerabilities

/entrypoint.sh: line 11: /github/workspace/node_modules/.bin/textlint: not found
/entrypoint.sh: line 13: /github/workspace/node_modules/.bin/textlint: not found
reviewdog: parse error: EOF

Any idea why this happens?

Thx, Sven

tsuyoshicho commented 4 years ago

Thanks report, I research it.

tsuyoshicho commented 4 years ago

Fix in v1.1.0! see https://github.com/tsuyoshicho/action-test-repo/pull/1

svenmueller commented 4 years ago

Hi, thx for checking! I still see an error like this:

/usr/bin/docker run --name cxyz --label 430c1a --workdir /github/workspace --rm -e INPUT_GITHUB_TOKEN -e INPUT_REPORTER -e INPUT_TEXTLINT_FLAGS -e INPUT_LEVEL -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/k8s-manifests/k8s-manifests":"/github/workspace" 430c1a:f1502371248448dcafb2dcdf42877455  "***" "error" "github-pr-review" "doc/**"
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.676s
found 0 vulnerabilities

/entrypoint.sh: line 11: /github/workspace/node_modules/.bin/textlint: not found
/entrypoint.sh: line 13: /github/workspace/node_modules/.bin/textlint: not found
reviewdog: parse error: EOF
svenmueller commented 4 years ago

@tsuyoshicho FYI

tsuyoshicho commented 4 years ago

Um... Reopen issue.

And @svenmueller, please your repo/workflow result URL.

My test repo work fine. https://github.com/tsuyoshicho/action-test-repo/pull/1/checks?check_run_id=603380361


If you re-run CI from action failed page's Re-run jobs button, this re-run use action at same Git SHA(no fixed SHA). Therefore, you try git commit --allow-empty -m "re-run CI" and push, it create new empty commit and re-run CI new Git SHA action(fixed) use.

svenmueller commented 4 years ago

It's a private repo, so i can't share the link here. It fails also on new git commits. Do i need to configure anything else or have some other required resources in the repo beside the .github/workflows/reviewdog.yml?

tsuyoshicho commented 4 years ago

Thanks response.

Okay, My success workflow is here.

Check your first workflow codeblock is fine. Ommm.....

Currently, other action I send PRed is suggested problem, Please wait for other and this re-fix(if need?)

tsuyoshicho commented 4 years ago

To @svenmueller

I also learned other projects and found out what was the right answer.

In conclusion, you should use project specific textlint and plugins, so you need to put package.json containing textlint in each user's repository.

We have also updated the README and organized it to include internal codes.

Thank you for your good point. I hope it works fine for you. (If you have a problem with package.json, see the test repository above)

Thanks