Skip to content

Commit

Permalink
fix(gha): access secret through env
Browse files Browse the repository at this point in the history
- Fixes the issue that `CODECOV_UPLOAD_TOKEN` secret was not available
  in the `if:` condition by putting it in a job-level environment
  variable `codecov_upload_token`.
  • Loading branch information
kikuomax committed Nov 21, 2023
1 parent 2855765 commit 557fa01
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ jobs:
msrv:
name: MSRV
runs-on: ubuntu-20.04
env:
codecov_upload_token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand Down Expand Up @@ -260,8 +262,8 @@ jobs:
run: cargo llvm-cov --all-features --lcov --output-path ./lcov.info

- name: Report to codecov.io
if: ${{ env.codecov_upload_token }}
uses: codecov/codecov-action@v3
if: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
with:
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
files: ./lcov.info
Expand Down

0 comments on commit 557fa01

Please sign in to comment.