Skip to content

Commit 90e354f

Browse files
authored
Pin PyGithub Dependency Using uv Lockfile (#736)
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 `tagging.py` - Generated `tagging.py.lock` with pinned versions and hashes - Updated `tagging.yml` to use `uv run --locked` instead of pip ## Review Guide - **Core**: `tagging.py` preamble + `tagging.yml` workflow change - **Generated**: `tagging.py.lock` - verify it resolves PyGithub and deps Co-authored-by: Omer Lachish <rauchy@users.noreply.github.com>
1 parent 9ba5491 commit 90e354f

3 files changed

Lines changed: 308 additions & 6 deletions

File tree

.github/workflows/tagging.yml

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

6260
- name: Run script
6361
env:
6462
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
6563
GITHUB_REPOSITORY: ${{ github.repository }}
66-
run: |
67-
python tagging.py
64+
run: uv run --locked tagging.py

tagging.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python3
2+
# /// script
3+
# dependencies = ["PyGithub>=2,<3", "pyjwt<2.12.0", "charset-normalizer<3.4.6"]
4+
# ///
25

36
import os
47
import re

0 commit comments

Comments
 (0)