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

400: pr must match pattern #61

Closed
CasperWA opened this issue Mar 9, 2020 · 2 comments
Closed

400: pr must match pattern #61

CasperWA opened this issue Mar 9, 2020 · 2 comments

Comments

@CasperWA
Copy link

CasperWA commented Mar 9, 2020

I got the following error when re-running a GH Actions workflow.

https://codecov.io/upload/v4?package=bash-20200303-bc4d7e6&token=secret&branch=tokenless_coverage_uploads&commit=46572a64ab028b892260fcb39096dcd766043e4a&build=52168147&build_url=http%3A%2F%2Fgithub.com%2Faiidateam%2Faiida-core%2Factions%2Fruns%2F52168147&name=aiida-pytests-py3.5-django&tag=&slug=aiidateam%2Faiida-core&service=github-actions&flags=django&pr=refs/heads/tokenless_coverage_uploads&job=
    -> Uploading
    X> Failed to upload
    -> Sleeping for 30s and trying again...
    -> Uploading to Codecov
    HTTP 400
pr must match pattern ^(\d+|false|null|undefined|true)$

It seems it doesn't catch the PR's number, but instead the reference head.

Using v1 with the following setup in my workflow:

    - name: Upload coverage report
      uses: codecov/codecov-action@v1
      with:
        name: aiida-pytests-py3.5-${{ matrix.backend }}
        flags: ${{ matrix.backend }}
        file: ./coverage.xml
        fail_ci_if_error: true

Looking through the issues and PRs here, it seems related to the usage of actions/checkout@v2 (based on the discussion #53 and #52).

From your most recent README, it's clear actions/checkout@master is recommended, but the fact that v2 does not work is not clear.

In addition, the CI job did not fail, even though the error above was thrown (and fail_ci_if_error: true was set).

@CasperWA
Copy link
Author

CasperWA commented Mar 16, 2020

I'm still getting this issue, but slightly different. The PR number scraping is quite fragile, it seems. Pushing more commits to an already created PR results in the upload call to coverage.io to include an empty key-value-pair for the pr key, i.e., ...&pr=&.... Never mind, was explicitly using the older version (v1.0.5). I have now switched to v1 (i.e., the latest v1.x.y) and it seems to works beautifully. Thanks for the fix 👍

@ibrahim0814
Copy link
Contributor

No problem!

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

No branches or pull requests

2 participants