From 2bccac9c0e6bc6c5519e783328c5fa3dba307d90 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 20 Nov 2024 18:44:38 -0500 Subject: [PATCH 1/2] fix: use head repo --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e42465a..5b711bfc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ name: Workflow for Codecov example-python -on: [push, pull_request] +on: [push, pull_request, pull_request_target] jobs: run: runs-on: ubuntu-latest @@ -15,9 +15,9 @@ jobs: - name: Install dependencies run: pip install -r requirements.txt - name: Run tests and collect coverage - run: pytest --cov app ${{ env.CODECOV_ATS_TESTS }} + run: pytest --cov app - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@th/fix-head-repo-for-tokenless with: verbose: true env: From 5432c793f64a5274895b66b8058abbbc44b4f131 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 20 Nov 2024 18:47:17 -0500 Subject: [PATCH 2/2] fix: test it all --- .github/workflows/ci.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b711bfc..6b33d046 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,9 @@ +--- name: Workflow for Codecov example-python on: [push, pull_request, pull_request_target] +permissions: + id-token: write # This is required for requesting the JWT + contents: read jobs: run: runs-on: ubuntu-latest @@ -16,9 +20,18 @@ jobs: run: pip install -r requirements.txt - name: Run tests and collect coverage run: pytest --cov app - - name: Upload coverage to Codecov + - name: Upload coverage to Codecov (token) uses: codecov/codecov-action@th/fix-head-repo-for-tokenless with: verbose: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage to Codecov (oidc) + uses: codecov/codecov-action@th/fix-head-repo-for-tokenless + with: + verbose: true + use_oidc: true + - name: Upload coverage to Codecov (no token) + uses: codecov/codecov-action@th/fix-head-repo-for-tokenless + with: + verbose: true