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

Upload fails with token present on a public branch #98

Closed
aik099 opened this issue Nov 15, 2024 · 1 comment
Closed

Upload fails with token present on a public branch #98

aik099 opened this issue Nov 15, 2024 · 1 comment

Comments

@aik099
Copy link

aik099 commented Nov 15, 2024

I'm getting the Token required because branch is protected error when using the codecov/test-results-action@v1 action on a public branch with the token specified.

The build URL: https://github.com/minkphp/MinkSelenium2Driver/actions/runs/11858426514/job/33049022444?pr=403

Workflow file fragment:

      - name: Upload coverage to Codecov
        if: ${{ matrix.with_coverage == true && !cancelled() }}
        uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage.xml

      - name: Upload test results to Codecov
        if: ${{ matrix.with_coverage == true && !cancelled() }}
        uses: codecov/test-results-action@v1
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          verbose: true

Build output:

==> linux OS detected
https://cli.codecov.io/latest/linux/codecov.SHA256SUM
Received SHA256SUM 53bf132251eacd7d338b34b69a7b3d0e2d71f95c9de97f0380b6045fc3673e36  codecov
Received SHA256SUM signature -----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEJwNOf9uFDgu8LGL/gGuyiu13mGkFAmc3Xy0ACgkQgGuyiu13
mGmXCw//a9tIdcMwdB+MbOLS3HOuJJJ33L230f8MJgTUj/HAqiD6tRTOTEN16x37
0J5V8ww/afpyYgjE3mErMOqrxdzdXZJ2bASS//dt9gHYQWMpx1Pdit0o8hEp82qC
1+CuC19QOdHpgFuvht/XP1CYdICxeJAzFPyfJEFy+o5O3jQJ8xIo9SaaJvGoXxOv
FUUQlL6UYWrY/4+GlY3qPwTxLcpyqL1+UMk88XTXEI7d814CrPiodeCTPWantV9j
KcviyIYxSCzwZFAbADNXczskwMxQgFDhl61EYMMvU790hv9VapT+LBeX4yXb3Qup
dXRMFSTWM1NtLYvUeKNpqO7IUDsHkO5ejcIQ8HSDO5nyuPeuMyOI0ZNKqQPjBQDc
UgIjXL21BYOkYgFZ1oM+l80lt9QgQJ+f/qG1NPQUiiHxLwBoBgaKnsYiKyHRh2EK
h+dL4J6wLATGA0nQr3VrQ4ErqBjg7Y77XlIZJ7ypF6I77i0xBKtqIeJGcN8CQIh4
ZXJ/apDKOZ8NzdQBjbNJyQnJ5ZZTH+G0ZnGnuHC679yzv058v+g3nbTP2GlVXgbD
+fSt8yaBRnxFtXQ5jjwvdq1drUhWldpJlhd6ZsdbJ+KH1iDjbeG6Itrg9FAhM6rM
en7aMtRdqjCL+OQ9f2bLuD6NVOPLHRr9vN/EOMZtTHvsUrCQNqg=
=aK7d
-----END PGP SIGNATURE-----

gpg: key 806BB28AED779869: "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
gpg: Signature made Fri Nov 15 14:48:13 2024 UTC
gpg:                using RSA key 27034E7FDB850E0BBC2C62FF806BB28AED779869
gpg: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 2703 4E7F DB85 0E0B BC2C  62FF 806B B28A ED77 9869
==> Uploader SHASUM verified (53bf132251eacd7d338b34b69a7b3d0e2d71f95c9de97f0380b6045fc3673e36  codecov)
==> Running version latest
==> Running version v9.0.4
==> Running command '/home/runner/work/_actions/codecov/test-results-action/v1/dist/codecov -v do-upload'
/home/runner/work/_actions/codecov/test-results-action/v1/dist/codecov -v do-upload -C c8989725096d5afe707e930f19bad272b807b414 --report-type test_results
info - 2024-[11](https://github.com/minkphp/MinkSelenium2Driver/actions/runs/11858426514/job/33049022444?pr=403#step:11:12)-15 14:56:00,946 -- ci service found: github-actions
debug - 2024-11-15 14:56:00,949 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
debug - 2024-11-15 [14](https://github.com/minkphp/MinkSelenium2Driver/actions/runs/11858426514/job/33049022444?pr=403#step:11:15):56:00,952 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
warning - 2024-11-[15](https://github.com/minkphp/MinkSelenium2Driver/actions/runs/11858426514/job/33049022444?pr=403#step:11:16) 14:56:00,954 -- No config file could be found. Ignoring config.
debug - 2024-11-15 14:56:00,954 -- No codecov_yaml found
debug - 2024-11-15 14:56:00,960 -- Starting upload processing --- {"verbose": true, "auto_load_params_from": null, "codecov_yml_path": null, "enterprise_url": null, "version": "cli-0.9.4", "command": "do-upload", "commit_sha": "c8989725096d5afe707e930f19bad272b807b414", "report_type": "test_results", "report_code": "default", "network_root_folder": "/home/runner/work/MinkSelenium2Driver/MinkSelenium2Driver", "files_search_root_folder": "/home/runner/work/MinkSelenium2Driver/MinkSelenium2Driver", "files_search_exclude_folders": [], "files_search_explicitly_listed_files": [], "disable_search": false, "disable_file_fixes": false, "build_code": "1[18](https://github.com/minkphp/MinkSelenium2Driver/actions/runs/11858426514/job/33049022444?pr=403#step:11:19)58426514", "build_url": "https://github.com/minkphp/MinkSelenium2Driver/actions/runs/11858426514", "job_code": "CI", "name": "11858426514", "branch": "codecov-tests-feat", "pull_request_number": "403", "env_vars": {}, "flags": [], "plugin_names": ["xcode", "gcov", "pycoverage"], "dry_run": false, "use_legacy_uploader": false, "handle_no_reports_found": false, "network_filter": null, "network_prefix": null, "gcov_args": null, "gcov_ignore": null, "gcov_include": null, "gcov_executable": null, "swift_project": null, "fail_on_error": false, "git_service": "github", "slug": "minkphp/MinkSelenium2Driver"}
debug - [20](https://github.com/minkphp/MinkSelenium2Driver/actions/runs/11858426514/job/33049022444?pr=403#step:11:21)24-11-15 14:56:00,960 -- Collecting relevant files
info - 2024-11-15 14:56:00,969 -- Found 1 test_results files to report
info - 2024-11-15 14:56:00,969 -- > /home/runner/work/MinkSelenium2Driver/MinkSelenium2Driver/junit.xml
debug - 2024-11-15 14:56:00,969 -- Selected uploader to use: <class 'codecov_cli.services.upload.upload_sender.UploadSender'>
debug - 20[24](https://github.com/minkphp/MinkSelenium2Driver/actions/runs/11858426514/job/33049022444?pr=403#step:11:25)-11-15 14:56:00,970 -- Sending upload request to Codecov
info - 2024-11-15 14:56:01,279 -- Process Upload complete
debug - 2024-11-15 14:56:01,280 -- Upload result --- {"result": "RequestResult(error=RequestError(code='HTTP Error 400', params={}, description='{\"message\":\"Token required because branch is protected\"}\\n'), warnings=[], status_code=400, text='{\"message\":\"Token required because branch is protected\"}\\n')"}
error - 2024-11-15 14:56:01,[28](https://github.com/minkphp/MinkSelenium2Driver/actions/runs/11858426514/job/33049022444?pr=403#step:11:29)0 -- Upload failed: {"message":"Token required because branch is protected"}

Any ideas?

P.S.
Uloading coverage reports works with the same token.

@aik099
Copy link
Author

aik099 commented Nov 19, 2024

This will happen when the action is only present in PR and not yet merged. After merging everything worked correctly.

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

1 participant