Skip to content

[BUG] "Upload failed: {"message":"Token required because branch is protected"}" when token is provided #1795

@danieleades

Description

@danieleades

Describe the bug
I've started seeing "Upload failed: {"message":"Token required because branch is protected"}" errors in an existing action. A token is provided.

Expected behavior

action should successfully upload coverage

Regression

it's a regression. started happening a couple of weeks ago

Versions

  • OS: linux
  • Git Host: GitHub
  • CI/CD: GitHub Actions
  • Uploader: codecov-action@v5.3.1

Commit and CI link

see https://github.com/danieleades/monzo-lib/actions/runs/13832526249/job/38780247143?pr=153

Additional context

job config:

  coverage:
    runs-on: ubuntu-latest
    steps:
      - name: checkout source
        uses: actions/checkout@v4

      - name: Install nightly toolchain
        uses: dtolnay/rust-toolchain@nightly
        with:
          components: llvm-tools-preview

      - name: Install cargo-llvm-cov
        uses: taiki-e/install-action@cargo-llvm-cov

      - name: Run llvm-cov
        run: cargo llvm-cov --all-features --doctests --workspace --lcov --output-path lcov.info

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        with:
          files: lcov.info
          token: ${{ secrets.CODECOV_TOKEN }}
          fail_ci_if_error: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions