github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Always getting Error: Bad response: 422 {"message":"Couldn't find a repository matching this job.","error":true}

Open irverysmart opened this issue 4 years ago • 3 comments

Trying to use a private repo with the github action using the following .yml:

on: ["push", "pull_request"]

name: Test Coveralls

jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:

    - uses: actions/checkout@v1

    - name: Use Node.js 10.x
      uses: actions/setup-node@v1
      with:
        node-version: 10.x

    - name: npm install, npm test -- --coverage
      run: |
        npm install
        npm test -- --coverage

    - name: Coveralls
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}

this is the exact same .yml provided on https://github.com/coverallsapp/github-action as the "standard example" with make test-coverage swapped for npm test -- --coverage (to generate lcov.info).

I've logged into the website and turned the repository "on" and I see the repository in the "my repos" tab, but still the action always fails with the following:

Screen Shot 2021-05-06 at 3 12 39 AM

I'm kind of stumped, are there some better docs to take a look at or any working examples?

irverysmart avatar May 06 '21 07:05 irverysmart

Same issue.

lc-soft avatar May 09 '21 09:05 lc-soft

hi @irverysmart and @lc-soft. for future reference, the more active resource for coveralls user support is here: https://github.com/lemurheavy/coveralls-public/issues

that error usually indicates a missing or incorrect repo token for your project.

that's usually avoided with our github action, because we're using the github_token secret, so this indicates some other key data is missing from the JSON you're POSTing to the coveralls API.

to look further into this for you i'll need your coveralls project URLs.

since they are private, you can email the info to [email protected] and reference this issue.

in the meantime, try setting this debug env var so your build logs reveal the underlying JSON you're about to send:

NODE_COVERALLS_DEBUG: 1

in your workflow file, like:

    - name: Coveralls
      uses: coverallsapp/github-action@master
      env:
        NODE_COVERALLS_DEBUG: 1
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}

afinetooth avatar May 11 '21 19:05 afinetooth

  1. You need to ensure the github-token is present.
  2. You need to ensure that you are running this GH action on your default branch. If you are running on other branches, this error will also happen.
    • You can either change your default branch (I did this and it worked), or
    • explicitly configure which branch to run via

PS: I have no idea if point 2 is an bug/issue or is it an intended behavior but it fixed my issue. Maybe add it to the README.md?

lamweili avatar Aug 02 '22 16:08 lamweili