codecov / codecov-action

GitHub Action that uploads coverage to Codecov :open_umbrella:
https://www.codecov.io
MIT License
1.49k stars 210 forks source link

Not valid tokenless upload #1548

Open greg0ire opened 3 months ago

greg0ire commented 3 months ago

As asked in https://github.com/codecov/codecov-action/issues/1487#issuecomment-2258551527, I'm opening a new ticket.

The failure is still happening for tokenless uploads for doctrine/dbal. What's weird is that I've seen it work on one of my own PRs, made from my fork.

Error message

error - 2024-08-17 09:46:06,912 -- Report creating failed: {"detail":"Not valid tokenless upload"}

Job definition

  upload_coverage:
    name: "Upload coverage to Codecov"
    runs-on: "ubuntu-22.04"
    needs:
      - "phpunit-smoke-check"
      - "phpunit-oci8"
      - "phpunit-pdo-oci"
      - "phpunit-postgres"
      - "phpunit-mariadb"
      - "phpunit-mysql"
      - "phpunit-mssql"
      - "phpunit-ibm-db2"

    steps:
      - name: "Checkout"
        uses: "actions/checkout@v4"
        with:
          fetch-depth: 2

      - name: "Download coverage files"
        uses: "actions/download-artifact@v4"
        with:
          path: "reports"

      - name: "Display structure of downloaded files"
        run: ls -R
        working-directory: reports

      - name: "Upload to Codecov"
        uses: "codecov/codecov-action@v4"
        with:
          directory: reports
          fail_ci_if_error: true
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Links

Dreamsorcerer commented 3 months ago

We're seeing this on forks too:

==> Running version v0.7.4 ==> Running command '/home/runner/work/_actions/codecov/test-results-action/v1/dist/codecov do-upload' /home/runner/work/_actions/codecov/test-results-action/v1/dist/codecov do-upload -Z -C 0021aac5623e5797aaa5d42668c6e1cd37005822 --report-type test_results ==> Uploader SHASUM verified (eb902009cb800fdefbce291c1357953f80e29382f43c7a98cce3b57d2b4d8cec codecov) info - 2024-08-21 06:36:09,917 -- ci service found: github-actions info - 2024-08-21 06:36:09,947 -- Found 1 test_results files to report info - 2024-08-21 06:36:09,947 -- > /home/runner/work/aiohttp/aiohttp/junit.xml info - 2024-08-21 06:36:10,010 -- Process Upload complete error - 2024-08-21 06:36:10,010 -- Upload failed: {"detail":"Not valid tokenless upload"} https://github.com/aio-libs/aiohttp/actions/runs/10484741376/job/29039606786?pr=8804

greg0ire commented 3 months ago

Yeah, sometimes it works, some other times it doesn't. That's why I wrongly thought https://github.com/doctrine/dbal/pull/6501 fixed the issue.

greg0ire commented 2 months ago

cc @derrabus

webknjaz commented 2 months ago

@Dreamsorcerer the workaround is to have the clear text token in the config.

ofek commented 2 months ago

I'm getting this when using OIDC, is that expected?

thomasrockhu-codecov commented 1 day ago

@greg0ire @Dreamsorcerer @webknjaz @ofek sorry for the delay here. I'm hoping that this has been remedied in v5. Are you all still experiencing this issue?

greg0ire commented 1 day ago

I would say it is working most of the time now, but I've seen it failed once. That's an improvement though, because before, it was failing most of the time.