Skip to content

Commit 03e02e0

Browse files
rustyconoverclaude
andcommitted
ci: public-repo hardening
- Add a least-privilege top-level 'permissions: contents: read' to ci.yml (it previously inherited the repo default token scope). The release workflow already scopes id-token: write per publish job for OIDC. - Bump actions/checkout@v4 -> v5 and astral-sh/setup-uv@v4 -> v8 in CI and release (clears the Node 20 runner deprecation; matches vgi-rpc). - Generalize the LocalStack test bucket name rusty-vgi-test -> vgi-offload-test (workflow + the two offload test defaults). No secrets are referenced by any workflow and CI uses pull_request (not pull_request_target), so fork PRs remain sandboxed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 593d925 commit 03e02e0

4 files changed

Lines changed: 18 additions & 13 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
branches: [main]
88
workflow_dispatch:
99

10+
# Least-privilege default for all jobs — none need write access. (The release
11+
# workflow grants id-token: write per-job for OIDC publishing; CI needs read.)
12+
permissions:
13+
contents: read
14+
1015
jobs:
1116
test:
1217
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
@@ -18,10 +23,10 @@ jobs:
1823
python-version: ["3.13", "3.14"]
1924

2025
steps:
21-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v5
2227

2328
- name: Install uv
24-
uses: astral-sh/setup-uv@v4
29+
uses: astral-sh/setup-uv@v8
2530

2631
- name: Set up Python ${{ matrix.python-version }}
2732
run: uv python install ${{ matrix.python-version }}
@@ -36,10 +41,10 @@ jobs:
3641
name: Lint
3742
runs-on: ubuntu-latest
3843
steps:
39-
- uses: actions/checkout@v4
44+
- uses: actions/checkout@v5
4045

4146
- name: Install uv
42-
uses: astral-sh/setup-uv@v4
47+
uses: astral-sh/setup-uv@v8
4348

4449
- name: Install dependencies
4550
run: uv sync --all-extras
@@ -72,16 +77,16 @@ jobs:
7277
SERVICES: s3
7378
AWS_DEFAULT_REGION: us-east-1
7479
steps:
75-
- uses: actions/checkout@v4
80+
- uses: actions/checkout@v5
7681

7782
- name: Checkout vgi-rpc
78-
uses: actions/checkout@v4
83+
uses: actions/checkout@v5
7984
with:
8085
repository: Query-farm/vgi-rpc-python
8186
path: vgi-rpc
8287

8388
- name: Install uv
84-
uses: astral-sh/setup-uv@v4
89+
uses: astral-sh/setup-uv@v8
8590

8691
- name: Set up Python 3.13
8792
run: uv python install 3.13
@@ -124,7 +129,7 @@ jobs:
124129
else:
125130
raise RuntimeError("LocalStack S3 did not become ready in time")
126131
127-
s3.create_bucket(Bucket="rusty-vgi-test")
132+
s3.create_bucket(Bucket="vgi-offload-test")
128133
PY
129134
130135
- name: Run HTTP S3 offload tests
@@ -133,7 +138,7 @@ jobs:
133138
AWS_SECRET_ACCESS_KEY: test
134139
AWS_DEFAULT_REGION: us-east-1
135140
VGI_RUN_S3_HTTP_TESTS: "1"
136-
VGI_HTTP_S3_BUCKET: rusty-vgi-test
141+
VGI_HTTP_S3_BUCKET: vgi-offload-test
137142
VGI_HTTP_S3_ENDPOINT_URL: http://127.0.0.1:4566
138143
PYTHONPATH: ${{ github.workspace }}
139144
run: uv run --no-sync pytest tests/test_http_s3_offload_output.py tests/test_http_s3_offload_input.py -q

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
name: Build distributions
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v5
3434

3535
- name: Install uv
36-
uses: astral-sh/setup-uv@v4
36+
uses: astral-sh/setup-uv@v8
3737

3838
- name: Build vgi (sdist + wheel)
3939
run: uv build --sdist --wheel --out-dir dist-vgi .

‎tests/test_http_s3_offload_input.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
RUN_S3_HTTP_TESTS_ENV = "VGI_RUN_S3_HTTP_TESTS"
2424
S3_BUCKET_ENV = "VGI_HTTP_S3_BUCKET"
2525
S3_ENDPOINT_ENV = "VGI_HTTP_S3_ENDPOINT_URL"
26-
DEFAULT_S3_BUCKET = "rusty-vgi-test"
26+
DEFAULT_S3_BUCKET = "vgi-offload-test"
2727

2828

2929
def _free_port() -> int:

‎tests/test_http_s3_offload_output.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
RUN_S3_HTTP_TESTS_ENV = "VGI_RUN_S3_HTTP_TESTS"
2424
S3_BUCKET_ENV = "VGI_HTTP_S3_BUCKET"
2525
S3_ENDPOINT_ENV = "VGI_HTTP_S3_ENDPOINT_URL"
26-
DEFAULT_S3_BUCKET = "rusty-vgi-test"
26+
DEFAULT_S3_BUCKET = "vgi-offload-test"
2727

2828

2929
def _free_port() -> int:

0 commit comments

Comments
 (0)