actions-rs/grcov

codecov not work for pr from fork repository

M-Adoo opened this issue · 1 comments

A pr from fork repository branch always failed:

Please provide the repository token to upload reports via `-t :repository-token`

workflow like this

jobs:
  grcov:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          override: true

      - name: Clean
        uses: actions-rs/cargo@v1
        with:
          command: clean
      - name: Execute tests
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all
        env:
          CARGO_INCREMENTAL: 0
          RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads"

      - name: Gather coverage data
        id: coverage
        uses: actions-rs/grcov@v0.1
        with:
          config: configs/grcov.config.yml
          coveralls-token: ${{ secrets.COVERALLS_TOKEN }}
      - name: Upload coverage to Codecov  
        uses: codecov/codecov-action@v1
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          file: ${{ steps.coverage.outputs.report }}
          fail_ci_if_error: true

pr from same repository branch is ok.

this is the full report: https://github.com/rxRust/rxRust/pull/59/checks

It is a known GitHub Actions issue: secrets are not shared for the forks, therefore ${{ secrets.CODECOV_TOKEN }} is not available for this build; here is a one of discussions about this thing: https://github.community/t5/GitHub-Actions/Make-secrets-available-to-builds-of-forks/m-p/30685

As it is unrelated to actions-rs, I'm going to close this issue.