Skip to content

Commit 53e7c5e

Browse files
fix: use OIDC for Codecov (#124)
*Issue #, if available:* *Description of changes:* Code coverage broke due to GitHub separating repository secrets from Dependabot secrets. Use the OIDC token to write code coverage data to Codecov. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Simon Marty <simon.marty0@gmail.com> Co-authored-by: Simon Marty <simon.marty0@gmail.com>
1 parent b2061f5 commit 53e7c5e

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

.github/workflows/go.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,33 @@ name: Go
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88

9-
jobs:
9+
permissions:
10+
contents: read
11+
id-token: write
1012

13+
jobs:
1114
build:
1215
runs-on: ubuntu-latest
1316
steps:
14-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
1518

16-
- name: Set up Go
17-
uses: actions/setup-go@v5
18-
with:
19-
go-version: '1.22'
19+
- name: Set up Go
20+
uses: actions/setup-go@v6
21+
with:
22+
go-version: "1.22"
2023

21-
- name: Build
22-
run: go build -v ./...
24+
- name: Build
25+
run: go build -v ./...
2326

24-
- name: Test
25-
run: go test -v ./secretcache -coverprofile=coverage.out -covermode=atomic
26-
27-
- name: Codecov
28-
uses: codecov/codecov-action@v5
29-
env:
30-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
27+
- name: Test
28+
run: go test -v ./secretcache -coverprofile=coverage.out -covermode=atomic
3129

30+
- name: Codecov
31+
uses: codecov/codecov-action@v5
32+
with:
33+
fail_ci_if_error: true
34+
use_oidc: true

0 commit comments

Comments
 (0)