I'm trying to set up Coveralls to work with GitHub Actions for a Python project, and although I've reviewed the documentation multiple times and followed all the instructions to the best of my understanding, I'm still facing the following error:
Bad Response 422 {“message”: “Couldn’t find a repository matching this job”, “error”: true}
Here is a minimal version of my YAML file:
name: coveralls
on:
pull_request:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: install requirements
run: |
pip install --upgrade pip
pip install pytest
pip install pytest-cov
pip install -r app/requirements.txt
- name: run tests
run: |
pytest --cov=app
coverage report -m
coverage lcov
- name: upload coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GH_TOKEN }}
path-to-lcov: coverage.lcov
The documentation is not clear enough at this point:
Name Requirement Description github-token
required Must be in form github-token: ${{ secrets.GITHUB_TOKEN }}
; Coveralls uses this token to verify the posted coverage data on the repo and create a new check based on the results. It is built into Github Actions and does not need to be manually specified in your secrets store. More Info
While it suggests that the GitHub token does not require manual specification in your secrets store, it is presented as a recommendation rather than a strict rule. It would be more appropriate to state that "it must not be manually specified", since using a custom variable like GH_TOKEN
instead of the default GITHUB_TOKEN
will not function properly.
That being said, you need to replace this line:
github-token: ${{ secrets.GH_TOKEN }}
with this line:
github-token: ${{ secrets.GITHUB_TOKEN }}
Thanks for the suggestion, @Andreas Volaris. We have updated our documentation on the Coveralls Github Action here, which now reads:
Name | Requirement | Description |
---|---|---|
github-token |
required | Default if not specified: ${{ github.token }} . Can be also specified this way: github-token: ${{ secrets.GITHUB_TOKEN }} ; Coveralls uses this token to verify the appropriate repo at Coveralls and send any new status updates based on your coverage results. This variable is built into Github Actions, so do not add it to your secrets store. More Info |
Just a note on the Coveralls Github Action: As an extension of the Github Actions CI service, it is the only Coveralls integration—official or otherwise—that uses a token other than the Coveralls Repo Token to identify your repo at Coveralls. The Coveralls Repo Token is a unique identifier that Coveralls generates for your repo and publishes on your Repo Page and Repo Settings page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With