Skip to content

Commit 25e03fb

Browse files
committed
ci: reduce API burden and stop using a PAT in trusted workflows
1 parent b72d59a commit 25e03fb

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ on:
88
- "v*"
99
workflow_dispatch:
1010

11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
# To reduce rate limitation issues, avoid running multiple workflows in
16+
# paralell for the same git ref (PR / branch / tag) at the same time by
17+
# discarding older in-progress runs in favor of the newest.
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1121
jobs:
1222
pre-commit:
1323
runs-on: ubuntu-24.04
@@ -35,16 +45,16 @@ jobs:
3545
tests:
3646
runs-on: ubuntu-24.04
3747
env:
38-
# Use TOKEN_READONLY if available (pushed branches), otherwise use GITHUB_TOKEN (PRs)
39-
# TOKEN_READONLY is a PAT for @choldgraf that only has read-access to this repo but isn't available in PRs.
40-
GITHUB_ACCESS_TOKEN: "${{ secrets.TOKEN_READONLY || github.token }}"
48+
GITHUB_ACCESS_TOKEN: "${{ github.token }}"
4149
strategy:
50+
# max-parallel declared to reduce rate limitation issues
51+
max-parallel: 1
4252
matrix:
4353
include:
4454
# Only test oldest supported and latest python version to reduce
4555
# GitHub API calls, as they can get rate limited
46-
- python-version: "3.10"
4756
- python-version: 3.x
57+
- python-version: "3.10"
4858

4959
steps:
5060
- uses: actions/checkout@v6

0 commit comments

Comments
 (0)