Skip to content

Commit 0d0ebe4

Browse files
authored
Pin PyGithub Dependency Using uv Lockfile (#4835)
This PR replaces the unpinned `pip install PyGithub` in the tagging workflow with `uv run --locked`, which uses a committed lockfile containing SHA-256 hashes for PyGithub and all its transitive dependencies. This hardens the release tagging pipeline against supply chain attacks on PyPI. Changes: - Added PEP 723 inline script metadata to `internal/genkit/tagging.py` - Generated `internal/genkit/tagging.py.lock` with pinned versions and hashes - Updated `tagging.yml` to use `uv run --locked` instead of pip ## Review Guide - **Core**: `internal/genkit/tagging.py` preamble + `tagging.yml` workflow change - **Generated**: `internal/genkit/tagging.py.lock` - verify it resolves PyGithub and deps Co-authored-by: Omer Lachish <rauchy@users.noreply.github.com>
1 parent 993fae3 commit 0d0ebe4

3 files changed

Lines changed: 309 additions & 6 deletions

File tree

.github/workflows/tagging.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,11 @@ jobs:
5151
git config user.name "Databricks SDK Release Bot"
5252
git config user.email "DECO-SDK-Tagging[bot]@users.noreply.github.com"
5353
54-
- name: Install dependencies
55-
run: |
56-
python -m pip install --upgrade pip
57-
pip install PyGithub
54+
- name: Install uv
55+
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
5856

5957
- name: Run script
6058
env:
6159
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
6260
GITHUB_REPOSITORY: ${{ github.repository }}
63-
run: |-
64-
python internal/genkit/tagging.py
61+
run: uv run --locked internal/genkit/tagging.py

internal/genkit/tagging.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/usr/bin/env python3
22

3+
# /// script
4+
# dependencies = ["PyGithub>=2,<3", "pyjwt<2.12.0", "charset-normalizer<3.4.6"]
5+
# ///
6+
37
import os
48
import re
59
import argparse

0 commit comments

Comments
 (0)