Skip to content

Commit 304561b

Browse files
ci: simplify release-drafter to read versions directly from versions.py
Agent-Logs-Url: https://github.com/cpp-linter/cpp-linter-hooks/sessions/457283cf-0c70-4642-98a9-2a98c6a0c6bb Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
1 parent 580f0ef commit 304561b

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

.github/workflows/release-drafter.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,12 @@ jobs:
1919
- name: Checkout repository
2020
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2121

22-
- name: Set up Python
23-
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
24-
with:
25-
python-version: "3.12"
26-
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
python -m pip install -e .
31-
3222
- name: Extract default tool versions
3323
id: versions
3424
run: |
35-
# Get versions from Python
36-
CLANG_FORMAT_VERSION=$(python -c "from cpp_linter_hooks.util import DEFAULT_CLANG_FORMAT_VERSION; print(DEFAULT_CLANG_FORMAT_VERSION)")
37-
CLANG_TIDY_VERSION=$(python -c "from cpp_linter_hooks.util import DEFAULT_CLANG_TIDY_VERSION; print(DEFAULT_CLANG_TIDY_VERSION)")
25+
# Get versions directly from versions.py (no package install needed)
26+
CLANG_FORMAT_VERSION=$(python3 -c "import sys; sys.path.insert(0, 'cpp_linter_hooks'); from versions import CLANG_FORMAT_VERSIONS; print(CLANG_FORMAT_VERSIONS[-1])")
27+
CLANG_TIDY_VERSION=$(python3 -c "import sys; sys.path.insert(0, 'cpp_linter_hooks'); from versions import CLANG_TIDY_VERSIONS; print(CLANG_TIDY_VERSIONS[-1])")
3828
3929
# Export to GitHub Actions environment for subsequent steps
4030
echo "CLANG_FORMAT_VERSION=$CLANG_FORMAT_VERSION" >> $GITHUB_ENV

0 commit comments

Comments
 (0)