Skip to content

Commit 982febc

Browse files
author
I766515
committed
chore: restore workflow files to avoid token scope restriction
1 parent 891ddc6 commit 982febc

3 files changed

Lines changed: 25 additions & 46 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
11
version: 2
22
updates:
3-
# Python pip dependencies
4-
# Non-major (minor + patch) version updates are batched into one grouped PR;
5-
# majors are left ungrouped so each breaking bump lands in its own PR for
6-
# review. Security updates (enabled in repo settings) come as a separate
7-
# grouped PR of their own
3+
# Python pip dependencies - security updates only
4+
# Regular version updates are disabled because we use compatible release
5+
# constraints (~=) in pyproject.toml to pin patch versions.
6+
# Dependabot Security Updates (enabled in repo settings) bypass these rules.
87
- package-ecosystem: "pip"
98
directory: "/"
109
schedule:
1110
interval: "weekly"
1211
day: "monday"
1312
time: "09:00"
14-
groups:
15-
version-minor-patch:
16-
patterns:
17-
- "*"
13+
# Ignore all regular version updates - security updates still come through
14+
ignore:
15+
- dependency-name: "*"
1816
update-types:
19-
- "minor"
20-
- "patch"
21-
security:
22-
applies-to: security-updates
23-
patterns:
24-
- "*"
25-
labels:
26-
- "dependencies"
17+
- "version-update:semver-major"
18+
- "version-update:semver-minor"
19+
- "version-update:semver-patch"
2720
# Commit message configuration
2821
commit-message:
2922
prefix: "chore"
@@ -46,11 +39,6 @@ updates:
4639
labels:
4740
- "dependencies"
4841
- "github-actions"
49-
# Batch all Actions bumps (including majors) into one PR
50-
groups:
51-
github-actions:
52-
patterns:
53-
- "*"
5442
commit-message:
5543
prefix: "chore"
5644
include: "scope"

‎.github/workflows/check-version-bump.yaml‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,29 @@ jobs:
1818
with:
1919
fetch-depth: 0
2020

21-
- name: Set up Python
22-
uses: actions/setup-python@v6
23-
with:
24-
python-version: "3.11"
25-
26-
- name: Install version comparison dependency
27-
run: python -m pip install packaging
28-
2921
- name: Check that version was bumped if src/ was modified
3022
run: |
3123
BASE_SHA="${{ github.event.pull_request.base.sha }}"
3224
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
33-
MERGE_BASE=$(git merge-base "$BASE_SHA" "$HEAD_SHA")
3425
35-
CHANGED_FILES=$(git diff --name-only "$MERGE_BASE" "$HEAD_SHA")
26+
CHANGED_FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")
3627
3728
if echo "$CHANGED_FILES" | grep -qE "^src/.*\.(py|pyi|proto)$"; then
38-
BASE_VERSION=$(git show "$MERGE_BASE:pyproject.toml" | grep "^version = " | cut -d'"' -f2)
29+
BASE_VERSION=$(git show "$BASE_SHA:pyproject.toml" | grep "^version = " | cut -d'"' -f2)
3930
HEAD_VERSION=$(git show "$HEAD_SHA:pyproject.toml" | grep "^version = " | cut -d'"' -f2)
4031
41-
# Use PEP 440 ordering because sort -V ranks RCs above final releases
42-
python .github/scripts/check_version_bump.py \
43-
"$BASE_VERSION" "$HEAD_VERSION"
32+
if [ "$BASE_VERSION" = "$HEAD_VERSION" ]; then
33+
echo "ERROR: Source files under src/ were modified but the version in pyproject.toml was not bumped (still $HEAD_VERSION)."
34+
exit 1
35+
fi
36+
37+
HIGHER=$(printf '%s\n' "$BASE_VERSION" "$HEAD_VERSION" | sort -V | tail -1)
38+
if [ "$HIGHER" != "$HEAD_VERSION" ]; then
39+
echo "ERROR: Version regression detected. Base is $BASE_VERSION but PR has $HEAD_VERSION."
40+
exit 1
41+
fi
4442
43+
echo "Version bump OK: $BASE_VERSION → $HEAD_VERSION"
4544
else
4645
echo "No source file changes under src/. Version bump not required."
4746
fi

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,13 @@ jobs:
2929
- name: Read package name and version from pyproject.toml
3030
id: metadata
3131
run: |
32-
python -m pip install toml packaging
32+
pip install toml
3333
PKG_NAME=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['name'])")
3434
VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
3535
echo "Publishing $PKG_NAME version $VERSION to PyPI"
3636
echo "name=$PKG_NAME" >> $GITHUB_OUTPUT
3737
echo "version=$VERSION" >> $GITHUB_OUTPUT
3838
39-
- name: Validate pre-release status
40-
env:
41-
PACKAGE_VERSION: ${{ steps.metadata.outputs.version }}
42-
RELEASE_IS_PRERELEASE: ${{ github.event.release.prerelease }}
43-
run: |
44-
python .github/scripts/validate_prerelease.py \
45-
"$PACKAGE_VERSION" "$RELEASE_IS_PRERELEASE"
46-
4739
- name: Check if version already exists on PyPI
4840
run: |
4941
PKG_NAME="${{ steps.metadata.outputs.name }}"
@@ -65,4 +57,4 @@ jobs:
6557
run: uv build
6658

6759
- name: Publish to PyPI
68-
uses: pypa/gh-action-pypi-publish@v1.14.2
60+
uses: pypa/gh-action-pypi-publish@v1.14.0

0 commit comments

Comments
 (0)