Skip to content

Commit 2bcd081

Browse files
committed
docs: recommend OpenID Connect instead of static token
1 parent 6a8e2b8 commit 2bcd081

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
lines changed

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@ GitHub Actions for running [CodSpeed](https://codspeed.io) in your CI.
2323
# More details on the instruments at https://docs.codspeed.io/instruments/
2424
mode: "instrumentation"
2525

26-
# [REQUIRED for private repositories]
27-
# The CodSpeed upload token: can be found at https://codspeed.io/<org>/<repo>/settings
26+
# [OPTIONAL]
27+
# CodSpeed recommends using OpenID Connect (OIDC) for authentication.
28+
#
29+
# If you are not using OpenID Connect, set the CodSpeed upload token
30+
# that can be found at https://codspeed.io/<org>/<repo>/settings
2831
# It's strongly recommended to use a secret for this value
29-
# If you're instrumenting a public repository, you can omit this value
32+
# If you're instrumenting a public repository, you can omit this value altogether
33+
#
34+
# More information in the CodSpeed documentation:
35+
# https://codspeed.io/docs/integrations/ci/github-actions#authentication
3036
token: ""
3137

3238
# [OPTIONAL]
@@ -84,6 +90,9 @@ jobs:
8490
benchmarks:
8591
name: Run benchmarks
8692
runs-on: ubuntu-latest
93+
permissions: # optional for public repositories
94+
contents: read
95+
id-token: write # for OpenID Connect authentication with CodSpeed
8796
steps:
8897
- uses: actions/checkout@v4
8998
- uses: actions/setup-python@v3
@@ -97,7 +106,6 @@ jobs:
97106
uses: CodSpeedHQ/action@v4
98107
with:
99108
mode: instrumentation
100-
token: ${{ secrets.CODSPEED_TOKEN }}
101109
run: pytest tests/ --codspeed
102110
```
103111
@@ -123,6 +131,9 @@ jobs:
123131
name: Run benchmarks
124132
benchmarks:
125133
runs-on: ubuntu-latest
134+
permissions: # optional for public repositories
135+
contents: read
136+
id-token: write # for OpenID Connect authentication with CodSpeed
126137
steps:
127138
- uses: actions/checkout@v4
128139

@@ -141,7 +152,6 @@ jobs:
141152
with:
142153
mode: instrumentation
143154
run: cargo codspeed run
144-
token: ${{ secrets.CODSPEED_TOKEN }}
145155
```
146156
147157
## Node.js with `codspeed-node`, TypeScript and `vitest`
@@ -166,6 +176,9 @@ jobs:
166176
benchmarks:
167177
name: Run benchmarks
168178
runs-on: ubuntu-latest
179+
permissions: # optional for public repositories
180+
contents: read
181+
id-token: write # for OpenID Connect authentication with CodSpeed
169182
steps:
170183
- uses: actions/checkout@v4
171184

@@ -179,5 +192,4 @@ jobs:
179192
with:
180193
mode: instrumentation
181194
run: npx vitest bench
182-
token: ${{ secrets.CODSPEED_TOKEN }}
183195
```

examples/nodejs-typescript-codspeed.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
name: Run benchmarks
1413
codspeed:
14+
name: Run benchmarks
1515
runs-on: ubuntu-latest
16+
permissions: # optional for public repositories
17+
contents: read
18+
id-token: write # for OpenID Connect authentication with CodSpeed
1619
steps:
1720
- uses: actions/checkout@v4
1821

@@ -26,4 +29,3 @@ jobs:
2629
with:
2730
mode: instrumentation
2831
run: node -r esbuild-register benches/bench.ts
29-
token: ${{ secrets.CODSPEED_TOKEN }}

examples/python-pytest-codspeed.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
codspeed:
1414
name: Run benchmarks
1515
runs-on: ubuntu-latest
16+
permissions: # optional for public repositories
17+
contents: read
18+
id-token: write # for OpenID Connect authentication with CodSpeed
1619
steps:
1720
- uses: actions/checkout@v4
1821

@@ -28,4 +31,3 @@ jobs:
2831
with:
2932
mode: instrumentation
3033
run: pytest tests/ --codspeed
31-
token: ${{ secrets.CODSPEED_TOKEN }}

examples/rust-cargo-codspeed.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
codspeed:
1414
name: Run benchmarks
1515
runs-on: ubuntu-latest
16+
permissions: # optional for public repositories
17+
contents: read
18+
id-token: write # for OpenID Connect authentication with CodSpeed
1619
steps:
1720
- uses: actions/checkout@v4
1821

@@ -31,4 +34,3 @@ jobs:
3134
with:
3235
mode: instrumentation
3336
run: cargo codspeed run
34-
token: ${{ secrets.CODSPEED_TOKEN }}

0 commit comments

Comments
 (0)