check-code-coverage icon indicating copy to clipboard operation
check-code-coverage copied to clipboard

check-against-readme always looks for the project-level README

Open markgoho opened this issue 5 years ago • 4 comments

The token is definitely being passed in, but for whatever reason isn't being found.

 Ensure coverage has not dropped 📈4s
    GITHUB_TOKEN: ***
Run DEBUG=check-code-coverage npx set-gh-status --check-against-readme
  DEBUG=check-code-coverage npx set-gh-status --check-against-readme
  shell: /bin/bash -e {0}
  env:
    GITHUB_TOKEN: ***
npx: installed 69 in 3.549s
Token must be provided!
##[error]Process completed with exit code 1.

It looks like this package assumes everything is at the root folder. After adding cd clients/html && to the npx line, it works, but then it's looking for the badge at the root-level README which doesn't have a badge.

markgoho avatar Jul 01 '20 17:07 markgoho

Weird, the code is pretty straightforward here https://github.com/bahmutov/check-code-coverage/blob/master/bin/set-gh-status.js#L101

Is your action written like this?

- name: Ensure coverage has not dropped 📈
  run: npx set-gh-status --check-against-readme
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Is this a local pull request or a request from a forked repository?

bahmutov avatar Jul 01 '20 17:07 bahmutov

@bahmutov so this was more a matter of not specifying the directory I was in, this now works:

- name: Ensure coverage has not dropped 📈
        run: cd clients/html && npx set-gh-status
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

However, if I try to check this against the README file, it looks for the root-level README. Is there a way we could look for a readme file in the directory that set-gh-status is being run in? Cf. https://github.com/bahmutov/check-code-coverage/blob/master/src/index.js#L70 -- how about: path.join(__dirname, 'README.md')?

image

markgoho avatar Jul 01 '20 17:07 markgoho

Sure, I would be open to a pull request to add this

Sent from my iPhone

On Jul 1, 2020, at 13:23, Mark Goho [email protected] wrote:

 @bahmutov so this was more a matter of not specifying the directory I was in, this now works:

  • name: Ensure coverage has not dropped 📈 run: cd clients/html && npx set-gh-status env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} However, if I try to check this against the README file, it looks for the root-level README. Is there a way we could look for a readme file in the directory that set-gh-status is being run in?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bahmutov avatar Jul 01 '20 17:07 bahmutov

#17 open for this issue

markgoho avatar Jul 01 '20 18:07 markgoho