keep-github-workflows-active 2.1.5__tar.gz → 2.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. keep_github_workflows_active-2.3.0/.github/workflows/activate_workflows_priv.yml +218 -0
  2. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.github/workflows/default_cicd_public.yml +84 -16
  3. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/CHANGELOG.md +30 -0
  4. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/Makefile +1 -1
  5. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/PKG-INFO +10 -11
  6. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/README.md +0 -1
  7. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/pyproject.toml +21 -15
  8. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/src/keep_github_workflows_active/__init__conf__.py +1 -1
  9. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/src/keep_github_workflows_active/keep_github_workflow_active.py +26 -7
  10. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/tests/test_github_integration.py +27 -4
  11. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.devcontainer/devcontainer.json +0 -0
  12. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.devcontainer/settings.json +0 -0
  13. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.env.example +0 -0
  14. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.github/actions/extract-metadata/action.yml +0 -0
  15. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.github/dependabot.yml +0 -0
  16. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.github/workflows/activate_workflows.yml +0 -0
  17. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.github/workflows/codeql.yml +0 -0
  18. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.github/workflows/default_release_public.yml +0 -0
  19. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.gitignore +0 -0
  20. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.qlty/qlty.toml +0 -0
  21. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/.snyk +0 -0
  22. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/CLAUDE.md +0 -0
  23. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/CONTRIBUTING.md +0 -0
  24. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/DEVELOPMENT.md +0 -0
  25. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/INSTALL.md +0 -0
  26. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/LICENSE +0 -0
  27. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/codecov.yml +0 -0
  28. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/concept.md +0 -0
  29. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/docs/systemdesign/SECURITY.md +0 -0
  30. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/docs/systemdesign/module_reference.md +0 -0
  31. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/notebooks/Quickstart.ipynb +0 -0
  32. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/src/keep_github_workflows_active/__init__.py +0 -0
  33. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/src/keep_github_workflows_active/__main__.py +0 -0
  34. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/src/keep_github_workflows_active/behaviors.py +0 -0
  35. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/src/keep_github_workflows_active/cli.py +0 -0
  36. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/src/keep_github_workflows_active/doctest.env +0 -0
  37. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/src/keep_github_workflows_active/py.typed +0 -0
  38. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/src/keep_github_workflows_active/sanitization.py +0 -0
  39. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/tests/conftest.py +0 -0
  40. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/tests/test_behaviors.py +0 -0
  41. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/tests/test_cli.py +0 -0
  42. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/tests/test_metadata.py +0 -0
  43. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/tests/test_module_entry.py +0 -0
  44. {keep_github_workflows_active-2.1.5 → keep_github_workflows_active-2.3.0}/tests/test_sanitization.py +0 -0
@@ -0,0 +1,218 @@
1
+ name: Activate Organisation Workflows
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, master ]
6
+ pull_request:
7
+ branches: [ main, master ]
8
+ schedule:
9
+ - cron: "47 3 * * 5" # Every Friday at 03:47 UTC
10
+
11
+ jobs:
12
+ test:
13
+ name: Tests (Python ${{ matrix.python }}, ${{ matrix.os }})
14
+ runs-on: ${{ matrix.os }}
15
+ env:
16
+ SECRET_GITHUB_TOKEN: ${{ secrets.SECRET_GITHUB_TOKEN2 }}
17
+ SECRET_GITHUB_OWNER: ${{ secrets.SECRET_GITHUB_OWNER2 }}
18
+ PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ os: [ubuntu-latest]
23
+ # Test against the latest CPython 3.x release provided by Actions
24
+ python: ["3.x"]
25
+ steps:
26
+ - uses: actions/checkout@v6
27
+ - uses: actions/setup-python@v6
28
+ with:
29
+ python-version: ${{ matrix.python }}
30
+ cache: 'pip'
31
+ - name: Install uv
32
+ uses: astral-sh/setup-uv@v7
33
+ with:
34
+ enable-cache: true
35
+ - name: Extract project metadata
36
+ shell: python
37
+ run: |
38
+ import os
39
+ import tomllib
40
+ from pathlib import Path
41
+
42
+ data = tomllib.loads(Path('pyproject.toml').read_text('utf-8'))
43
+ project = data['project']['name']
44
+ module = project.replace('-', '_')
45
+ dash = project.replace('_', '-')
46
+ scripts = list(data['project'].get('scripts', {}).keys())
47
+ cli_bin = scripts[0] if scripts else dash
48
+
49
+ with open(os.environ['GITHUB_ENV'], 'a', encoding='utf-8') as env:
50
+ env.write(f"PROJECT_NAME={project}\n")
51
+ env.write(f"PACKAGE_MODULE={module}\n")
52
+ env.write(f"CLI_BIN={cli_bin}\n")
53
+ - name: Install journald prerequisites
54
+ if: runner.os == 'Linux'
55
+ shell: bash
56
+ run: |
57
+ sudo apt-get update
58
+ sudo apt-get install -y python3-systemd
59
+
60
+ - name: Install dev deps with uv
61
+ shell: bash
62
+ run: |
63
+ uv pip install --system -e .[dev]
64
+
65
+ - name: Run full test suite (lint, types, tests, coverage, codecov)
66
+ shell: bash
67
+ env:
68
+ TEST_VERBOSE: "1"
69
+ run: make test
70
+ - name: Build wheel/sdist
71
+ shell: bash
72
+ run: uv build
73
+ - name: Verify wheel install in clean env
74
+ shell: bash
75
+ run: |
76
+ uv venv .venv_wheel
77
+ . .venv_wheel/bin/activate 2>/dev/null || . .venv_wheel/Scripts/activate 2>/dev/null
78
+ uv pip install dist/*.whl
79
+ "$CLI_BIN" --version 2>/dev/null || python -m "$PACKAGE_MODULE" --version
80
+
81
+ activate:
82
+ name: Enable workflows & delete old runs (bitranox)
83
+ needs: test
84
+ # if: github.event_name == 'schedule'
85
+ runs-on: ubuntu-latest
86
+ env:
87
+ SECRET_GITHUB_TOKEN: ${{ secrets.SECRET_GITHUB_TOKEN }}
88
+ SECRET_GITHUB_OWNER: ${{ secrets.SECRET_GITHUB_OWNER }}
89
+ steps:
90
+ - uses: actions/checkout@v6
91
+ - uses: actions/setup-python@v6
92
+ with:
93
+ python-version: "3.x"
94
+ cache: 'pip'
95
+ - name: Install uv
96
+ uses: astral-sh/setup-uv@v7
97
+ with:
98
+ enable-cache: true
99
+ - name: Install package
100
+ run: uv pip install --system -e .
101
+ - name: Enable all workflows
102
+ run: keep-github-workflows-active enable-all-workflows
103
+ - name: Delete old workflow runs
104
+ run: keep-github-workflows-active delete-old-workflow-runs
105
+
106
+ activate-org:
107
+ name: Enable workflows & delete old runs (RotekHandelsGmbH)
108
+ needs: test
109
+ if: github.event_name == 'schedule'
110
+ runs-on: ubuntu-latest
111
+ env:
112
+ SECRET_GITHUB_TOKEN: ${{ secrets.SECRET_GITHUB_TOKEN2 }}
113
+ SECRET_GITHUB_OWNER: ${{ secrets.SECRET_GITHUB_OWNER2 }}
114
+ steps:
115
+ - uses: actions/checkout@v6
116
+ - uses: actions/setup-python@v6
117
+ with:
118
+ python-version: "3.x"
119
+ cache: 'pip'
120
+ - name: Install uv
121
+ uses: astral-sh/setup-uv@v7
122
+ with:
123
+ enable-cache: true
124
+ - name: Install package
125
+ run: uv pip install --system -e .
126
+ - name: Enable all workflows
127
+ run: keep-github-workflows-active enable-all-workflows
128
+ - name: Delete old workflow runs
129
+ run: keep-github-workflows-active delete-old-workflow-runs
130
+
131
+ pipx-uv:
132
+ name: pipx/uv verification (ubuntu)
133
+ runs-on: ubuntu-latest
134
+ steps:
135
+ - uses: actions/checkout@v6
136
+ - uses: actions/setup-python@v6
137
+ with:
138
+ python-version: "3.13"
139
+ cache: 'pip'
140
+ - name: Extract project metadata
141
+ shell: python
142
+ run: |
143
+ import os
144
+ import tomllib
145
+ from pathlib import Path
146
+
147
+ data = tomllib.loads(Path('pyproject.toml').read_text('utf-8'))
148
+ project = data['project']['name']
149
+ module = project.replace('-', '_')
150
+ dash = project.replace('_', '-')
151
+ scripts = list(data['project'].get('scripts', {}).keys())
152
+ cli_bin = scripts[0] if scripts else dash
153
+
154
+ with open(os.environ['GITHUB_ENV'], 'a', encoding='utf-8') as env:
155
+ env.write(f"PROJECT_NAME={project}\n")
156
+ env.write(f"PACKAGE_MODULE={module}\n")
157
+ env.write(f"CLI_BIN={cli_bin}\n")
158
+ - name: Install uv
159
+ uses: astral-sh/setup-uv@v7
160
+ with:
161
+ enable-cache: true
162
+ - name: Build wheel
163
+ run: uv build
164
+ - name: pipx install from wheel
165
+ run: |
166
+ python -m pip install pipx
167
+ pipx install dist/*.whl
168
+ "$CLI_BIN" --version 2>/dev/null || python -m "$PACKAGE_MODULE" --version
169
+ - name: uv tool install
170
+ run: |
171
+ uv tool install .
172
+ "$CLI_BIN" --version 2>/dev/null || python -m "$PACKAGE_MODULE" --version
173
+
174
+ notebooks:
175
+ name: Execute notebooks (ubuntu, Python 3.13)
176
+ runs-on: ubuntu-latest
177
+ steps:
178
+ - uses: actions/checkout@v6
179
+ - uses: actions/setup-python@v6
180
+ with:
181
+ python-version: "3.13"
182
+ cache: 'pip'
183
+ - name: Install uv
184
+ uses: astral-sh/setup-uv@v7
185
+ with:
186
+ enable-cache: true
187
+ - name: Install notebook runner deps
188
+ run: |
189
+ uv pip install --system nbclient nbformat ipykernel jupyter_client
190
+ python -m ipykernel install --user --name python3 --display-name "Python 3"
191
+ - name: Execute Quickstart notebook
192
+ env:
193
+ PIP_DISABLE_PIP_VERSION_CHECK: "1"
194
+ PIP_NO_INPUT: "1"
195
+ run: |
196
+ python - << 'PY'
197
+ from pathlib import Path
198
+
199
+ import nbformat
200
+ from nbclient import NotebookClient
201
+
202
+ nb_path = Path('notebooks/Quickstart.ipynb')
203
+ if not nb_path.exists():
204
+ raise SystemExit(f"Notebook not found: {nb_path}")
205
+
206
+ notebook = nbformat.read(nb_path, as_version=4)
207
+ client = NotebookClient(
208
+ notebook,
209
+ timeout=900,
210
+ kernel_name='python3',
211
+ allow_errors=False,
212
+ )
213
+ client.execute()
214
+
215
+ out_path = Path('notebooks/Quickstart-executed.ipynb')
216
+ nbformat.write(notebook, out_path)
217
+ print(f"Executed notebook written to: {out_path}")
218
+ PY
@@ -11,24 +11,27 @@ on:
11
11
 
12
12
  jobs:
13
13
  setup:
14
- name: Extract Python versions from pyproject.toml
14
+ name: Extract Python versions and OS matrix from pyproject.toml
15
15
  runs-on: ubuntu-latest
16
16
  outputs:
17
- python-versions: ${{ steps.versions.outputs.python-versions }}
18
- python-latest: ${{ steps.versions.outputs.python-latest }}
17
+ python-versions: ${{ steps.metadata.outputs.python-versions }}
18
+ python-latest: ${{ steps.metadata.outputs.python-latest }}
19
+ os-matrix: ${{ steps.metadata.outputs.os-matrix }}
19
20
  steps:
20
21
  - uses: actions/checkout@v6
21
22
  - uses: actions/setup-python@v6
22
23
  with:
23
24
  python-version: "3.x"
24
- - name: Parse classifiers for Python versions
25
- id: versions
25
+ - name: Parse pyproject.toml for Python versions and OS matrix
26
+ id: metadata
26
27
  shell: python
27
28
  run: |
28
29
  import json, os, tomllib
29
30
 
30
31
  with open("pyproject.toml", "rb") as f:
31
32
  data = tomllib.load(f)
33
+
34
+ # Python versions from classifiers
32
35
  classifiers = data.get("project", {}).get("classifiers", [])
33
36
  prefix = "Programming Language :: Python :: "
34
37
  versions = [
@@ -38,9 +41,15 @@ jobs:
38
41
  ]
39
42
  if not versions:
40
43
  raise SystemExit("No Python X.Y versions found in classifiers")
44
+
45
+ # OS matrix from [tool.ci]
46
+ ci_config = data.get("tool", {}).get("ci", {})
47
+ os_list = ci_config.get("os", ["ubuntu-latest"])
48
+
41
49
  with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
42
50
  fh.write(f"python-versions={json.dumps(versions)}\n")
43
51
  fh.write(f"python-latest={versions[-1]}\n")
52
+ fh.write(f"os-matrix={json.dumps(os_list)}\n")
44
53
 
45
54
  test:
46
55
  name: Tests (Python ${{ matrix.python }}, ${{ matrix.os }})
@@ -49,7 +58,7 @@ jobs:
49
58
  strategy:
50
59
  fail-fast: false
51
60
  matrix:
52
- os: [ubuntu-latest, macos-latest, windows-latest]
61
+ os: ${{ fromJSON(needs.setup.outputs.os-matrix) }}
53
62
  python: ${{ fromJSON(needs.setup.outputs.python-versions) }}
54
63
  env:
55
64
  PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
@@ -77,23 +86,83 @@ jobs:
77
86
  id: metadata
78
87
  uses: ./.github/actions/extract-metadata
79
88
 
80
- - name: Install journald prerequisites
89
+ - name: Install CI system dependencies (Ubuntu)
81
90
  if: runner.os == 'Linux'
82
- shell: bash
91
+ shell: python
83
92
  run: |
84
- sudo apt-get update
85
- sudo apt-get install -y python3-systemd
93
+ import subprocess
94
+ try:
95
+ import tomllib
96
+ except ModuleNotFoundError:
97
+ import pip._vendor.tomli as tomllib
98
+ with open("pyproject.toml", "rb") as f:
99
+ data = tomllib.load(f)
100
+ deps = data.get("tool", {}).get("ci", {}).get("system-dependencies-ubuntu", [])
101
+ if deps:
102
+ print(f"Installing system packages: {' '.join(deps)}")
103
+ subprocess.check_call(["sudo", "apt-get", "update"])
104
+ subprocess.check_call(["sudo", "apt-get", "install", "-y", *deps])
105
+ else:
106
+ print("No CI system dependencies configured for Ubuntu.")
107
+
108
+ - name: Install CI system dependencies (macOS)
109
+ if: runner.os == 'macOS'
110
+ shell: python
111
+ run: |
112
+ import subprocess
113
+ try:
114
+ import tomllib
115
+ except ModuleNotFoundError:
116
+ import pip._vendor.tomli as tomllib
117
+ with open("pyproject.toml", "rb") as f:
118
+ data = tomllib.load(f)
119
+ deps = data.get("tool", {}).get("ci", {}).get("system-dependencies-macos", [])
120
+ if deps:
121
+ print(f"Installing system packages: {' '.join(deps)}")
122
+ subprocess.check_call(["brew", "install", *deps])
123
+ else:
124
+ print("No CI system dependencies configured for macOS.")
86
125
 
87
126
  - name: Install dev deps
88
127
  shell: bash
89
128
  run: |
90
129
  uv pip install -e .[dev] --system
91
130
 
92
- - name: Install Windows Event Log prerequisites
131
+ - name: Install CI system dependencies (Windows/choco)
93
132
  if: runner.os == 'Windows'
94
- shell: bash
133
+ shell: python
95
134
  run: |
96
- uv pip install pywin32 --system
135
+ import subprocess
136
+ try:
137
+ import tomllib
138
+ except ModuleNotFoundError:
139
+ import pip._vendor.tomli as tomllib
140
+ with open("pyproject.toml", "rb") as f:
141
+ data = tomllib.load(f)
142
+ deps = data.get("tool", {}).get("ci", {}).get("system-dependencies-windows-choco", [])
143
+ if deps:
144
+ print(f"Installing choco packages: {' '.join(deps)}")
145
+ subprocess.check_call(["choco", "install", "-y", *deps])
146
+ else:
147
+ print("No CI choco dependencies configured for Windows.")
148
+
149
+ - name: Install CI pip dependencies (Windows)
150
+ if: runner.os == 'Windows'
151
+ shell: python
152
+ run: |
153
+ import subprocess
154
+ try:
155
+ import tomllib
156
+ except ModuleNotFoundError:
157
+ import pip._vendor.tomli as tomllib
158
+ with open("pyproject.toml", "rb") as f:
159
+ data = tomllib.load(f)
160
+ deps = data.get("tool", {}).get("ci", {}).get("system-dependencies-windows-pip", [])
161
+ if deps:
162
+ print(f"Installing pip packages: {' '.join(deps)}")
163
+ subprocess.check_call(["uv", "pip", "install", *deps, "--system"])
164
+ else:
165
+ print("No CI pip dependencies configured for Windows.")
97
166
 
98
167
  # Self-hosted runners persist ruff cache via RUFF_CACHE_DIR volume mount,
99
168
  # so actions/cache is only needed on GitHub-hosted runners.
@@ -145,7 +214,7 @@ jobs:
145
214
  && steps.pytest.outcome == 'success'
146
215
  && matrix.os == 'ubuntu-latest'
147
216
  && matrix.python == needs.setup.outputs.python-latest
148
- uses: codecov/codecov-action@v5
217
+ uses: codecov/codecov-action@v6
149
218
  with:
150
219
  files: ${{ env.COV_REPORT_FILE }}
151
220
  fail_ci_if_error: false
@@ -201,8 +270,7 @@ jobs:
201
270
  exit 1
202
271
  fi
203
272
  if [[ "${{ steps.pipaudit.outcome }}" != "success" ]]; then
204
- echo "::error::pip-audit vulnerability scan failed"
205
- exit 1
273
+ echo "::warning::pip-audit vulnerability scan failed"
206
274
  fi
207
275
  echo "All checks passed!"
208
276
 
@@ -2,6 +2,36 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [2.3.0] - 2026-05-03
6
+
7
+ ### Added
8
+ - New `SkippedWorkflowType.UPDATE_GRAPH` enum value to skip GitHub-managed `update-graph` workflows during enablement (these can't be enabled via the standard Actions API)
9
+ - New pytest `integration` marker registered in `pyproject.toml`; live-API tests in `tests/test_github_integration.py` now carry both `local_only` and `integration` markers so `make testintegration` collects them
10
+
11
+ ### Changed
12
+ - CI/CD workflow updated: `default_cicd_public.yml` matrix and codecov-action v6
13
+ - `updrootvol` automation cleanup: removed snyk badge from README
14
+
15
+ ### Security
16
+ - Added `CVE-2026-3219` (pip 26.0.1 concatenated tar+ZIP confusion, no fix yet) to pip-audit ignore list
17
+ - Cleaned obsolete entries from pip-audit ignore list (resolved or not flagged): `GHSA-4xh5-x5gv-qwph`, `CVE-2026-4539`, `CVE-2026-25990`, `CVE-2025-8869`, `CVE-2026-1703`
18
+ - Restored `PYSEC-2022-42969` after verifying `py` 1.11.0 is still flagged in the local audit environment
19
+
20
+ ## [2.2.0] - 2026-03-29
21
+
22
+ ### Added
23
+ - Support for GitHub organisations in `get_repositories` (tries `/orgs/` endpoint first, falls back to `/users/`)
24
+ - New CI job to activate workflows and delete old runs for RotekHandelsGmbH organisation
25
+ - Dynamic workflow discovery in integration tests instead of hardcoded repo/workflow names
26
+
27
+ ### Fixed
28
+ - Strip whitespace from config values at lookup time (fixes Python 3.14 `http.client` rejecting header values with trailing newlines)
29
+ - Integration tests now skip unconditionally in CI using `CI` env var detection
30
+ - Fixed masked credential detection to use substring check instead of equality
31
+
32
+ ### Security
33
+ - Cleaned up CVE exclusion list: removed resolved entries (PYSEC-2022-43012, PYSEC-2025-49, CVE-2024-6345, CVE-2026-1703, CVE-2026-26007, CVE-2026-25990, CVE-2025-8869, CVE-2026-25645)
34
+
5
35
  ## [2.1.5] - 2026-03-25
6
36
 
7
37
  ### Changed
@@ -1,4 +1,4 @@
1
- # BMK MAKEFILE 2.9.0
1
+ # BMK MAKEFILE 2.9.1
2
2
  # do not alter this file - it might be overwritten on new versions of BMK
3
3
  # if You want to alter it, remove the first line # BMK MAKEFILE 1.0 - then it is a custom makefile and will not be overwritten
4
4
  # bmk Makefile — thin wrapper using `uv tool install` for persistent bmk
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keep_github_workflows_active
3
- Version: 2.1.5
3
+ Version: 2.3.0
4
4
  Summary: Template for python apps with registered cli commands
5
5
  Project-URL: Homepage, https://github.com/bitranox/keep_github_workflows_active
6
6
  Project-URL: Repository, https://github.com/bitranox/keep_github_workflows_active.git
@@ -17,22 +17,22 @@ Classifier: Programming Language :: Python :: 3 :: Only
17
17
  Classifier: Programming Language :: Python :: 3.14
18
18
  Classifier: Typing :: Typed
19
19
  Requires-Python: >=3.10
20
- Requires-Dist: lib-cli-exit-tools>=2.3.0
21
- Requires-Dist: pydantic>=2.12.5
22
- Requires-Dist: requests>=2.33.0
20
+ Requires-Dist: lib-cli-exit-tools>=2.3.1
21
+ Requires-Dist: pydantic>=2.13.3
22
+ Requires-Dist: requests>=2.33.1
23
23
  Requires-Dist: rich-click>=1.9.7
24
24
  Provides-Extra: dev
25
25
  Requires-Dist: bandit>=1.9.4; extra == 'dev'
26
- Requires-Dist: build>=1.4.2; extra == 'dev'
27
- Requires-Dist: codecov-cli>=11.2.7; extra == 'dev'
26
+ Requires-Dist: build>=1.5.0; extra == 'dev'
27
+ Requires-Dist: codecov-cli>=11.2.8; extra == 'dev'
28
28
  Requires-Dist: import-linter>=2.11; extra == 'dev'
29
29
  Requires-Dist: pip-audit>=2.10.0; extra == 'dev'
30
- Requires-Dist: pyright[nodejs]>=1.1.408; extra == 'dev'
30
+ Requires-Dist: pyright[nodejs]>=1.1.409; extra == 'dev'
31
31
  Requires-Dist: pytest-cov>=7.1.0; extra == 'dev'
32
- Requires-Dist: pytest>=9.0.2; extra == 'dev'
32
+ Requires-Dist: pytest>=9.0.3; extra == 'dev'
33
33
  Requires-Dist: rtoml>=0.13.0; extra == 'dev'
34
- Requires-Dist: ruff>=0.15.7; extra == 'dev'
35
- Requires-Dist: textual>=8.1.1; extra == 'dev'
34
+ Requires-Dist: ruff>=0.15.12; extra == 'dev'
35
+ Requires-Dist: textual>=8.2.5; extra == 'dev'
36
36
  Requires-Dist: twine>=6.2.0; extra == 'dev'
37
37
  Description-Content-Type: text/markdown
38
38
 
@@ -48,7 +48,6 @@ Description-Content-Type: text/markdown
48
48
  [![Code Style: Ruff](https://img.shields.io/badge/Code%20Style-Ruff-46A3FF?logo=ruff&labelColor=000)](https://docs.astral.sh/ruff/)
49
49
  [![codecov](https://codecov.io/gh/bitranox/keep_github_workflows_active/graph/badge.svg?token=UFBaUDIgRk)](https://codecov.io/gh/bitranox/keep_github_workflows_active)
50
50
  [![Maintainability](https://qlty.sh/badges/041ba2c1-37d6-40bb-85a0-ec5a8a0aca0c/maintainability.svg)](https://qlty.sh/gh/bitranox/projects/keep_github_workflows_active)
51
- [![Known Vulnerabilities](https://snyk.io/test/github/bitranox/keep_github_workflows_active/badge.svg)](https://snyk.io/test/github/bitranox/keep_github_workflows_active)
52
51
  [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
53
52
 
54
53
  > **CI cadence:** The GitHub Actions CI workflow runs automatically every Monday at 07:00 UTC, in addition to push and pull request triggers.
@@ -10,7 +10,6 @@
10
10
  [![Code Style: Ruff](https://img.shields.io/badge/Code%20Style-Ruff-46A3FF?logo=ruff&labelColor=000)](https://docs.astral.sh/ruff/)
11
11
  [![codecov](https://codecov.io/gh/bitranox/keep_github_workflows_active/graph/badge.svg?token=UFBaUDIgRk)](https://codecov.io/gh/bitranox/keep_github_workflows_active)
12
12
  [![Maintainability](https://qlty.sh/badges/041ba2c1-37d6-40bb-85a0-ec5a8a0aca0c/maintainability.svg)](https://qlty.sh/gh/bitranox/projects/keep_github_workflows_active)
13
- [![Known Vulnerabilities](https://snyk.io/test/github/bitranox/keep_github_workflows_active/badge.svg)](https://snyk.io/test/github/bitranox/keep_github_workflows_active)
14
13
  [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
15
14
 
16
15
  > **CI cadence:** The GitHub Actions CI workflow runs automatically every Monday at 07:00 UTC, in addition to push and pull request triggers.
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "keep_github_workflows_active"
3
- version = "2.1.5"
3
+ version = "2.3.0"
4
4
  description = "Template for python apps with registered cli commands"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
7
- dependencies = ["rich-click>=1.9.7", "lib_cli_exit_tools>=2.3.0", "requests>=2.33.0", "pydantic>=2.12.5"]
7
+ dependencies = ["rich-click>=1.9.7", "lib_cli_exit_tools>=2.3.1", "requests>=2.33.1", "pydantic>=2.13.3"]
8
8
  license = { text = "MIT" }
9
9
  authors = [{ name = "bitranox", email = "bitranox@gmail.com" }]
10
10
  keywords = ["logging", "rich", "cli", "terminal", "ansi"]
@@ -19,6 +19,15 @@ classifiers = [
19
19
  "Programming Language :: Python :: 3.14",
20
20
  ]
21
21
 
22
+ # System packages required for CI runners (read by GitHub Actions workflow template)
23
+ # Format: "apt_package_name" for Ubuntu, future: {"apt": "...", "brew": "...", "choco": "..."}
24
+ [tool.ci]
25
+ system-dependencies-ubuntu = []
26
+ system-dependencies-macos = []
27
+ system-dependencies-windows-pip = []
28
+ system-dependencies-windows-choco = []
29
+ os = ["ubuntu-latest", "windows-latest", "macos-latest"]
30
+
22
31
  [project.urls]
23
32
  Homepage = "https://github.com/bitranox/keep_github_workflows_active"
24
33
  Repository = "https://github.com/bitranox/keep_github_workflows_active.git"
@@ -26,16 +35,16 @@ Issues = "https://github.com/bitranox/keep_github_workflows_active/issues"
26
35
 
27
36
  [project.optional-dependencies]
28
37
  dev = [
29
- "pytest>=9.0.2",
38
+ "pytest>=9.0.3",
30
39
  "pytest-cov>=7.1.0",
31
- "ruff>=0.15.7",
32
- "pyright[nodejs]>=1.1.408",
40
+ "ruff>=0.15.12",
41
+ "pyright[nodejs]>=1.1.409",
33
42
  "bandit>=1.9.4",
34
- "build>=1.4.2",
43
+ "build>=1.5.0",
35
44
  "twine>=6.2.0",
36
- "codecov-cli>=11.2.7",
45
+ "codecov-cli>=11.2.8",
37
46
  "pip-audit>=2.10.0",
38
- "textual>=8.1.1",
47
+ "textual>=8.2.5",
39
48
  "import-linter>=2.11",
40
49
  "rtoml>=0.13.0"
41
50
  ]
@@ -82,6 +91,7 @@ markers = [
82
91
  "os_posix: test exercises behavior requiring POSIX semantics",
83
92
  "os_linux: test exercises Linux-only behavior",
84
93
  "local_only: test requires local credentials or resources unavailable in CI",
94
+ "integration: test exercises external systems (e.g. live GitHub API)",
85
95
  ]
86
96
 
87
97
  [tool.coverage.run]
@@ -144,10 +154,6 @@ layers = [
144
154
 
145
155
  [tool.pip-audit]
146
156
  # Known vulnerabilities to ignore (unfixable or accepted risk)
147
- # GHSA-4xh5-x5gv-qwph: py library ReDoS (no fix available, low risk)
148
- # PYSEC-2022-42969: same as above (alias)
149
- # setuptools 65.5.0: transitive dep, pinned by build tools
150
- # PYSEC-2022-43012: fixed in 65.5.1
151
- # PYSEC-2025-49: fixed in 78.1.1
152
- # CVE-2024-6345: fixed in 70.0.0
153
- ignore-vulns = ["GHSA-4xh5-x5gv-qwph", "PYSEC-2022-42969", "PYSEC-2022-43012", "PYSEC-2025-49", "CVE-2024-6345","CVE-2026-1703","CVE-2026-26007","CVE-2026-4539","CVE-2026-25990","CVE-2025-8869","CVE-2026-25645"]
157
+ # CVE-2026-3219: pip 26.0.1 concatenated tar+ZIP confusion, no fix released yet
158
+ # PYSEC-2022-42969: py 1.11.0 ReDoS via crafted SVN info, no fix available
159
+ ignore-vulns = ["CVE-2026-3219", "PYSEC-2022-42969"]
@@ -24,7 +24,7 @@ name = "keep_github_workflows_active"
24
24
  #: Human-readable summary shown in CLI help output.
25
25
  title = "Template for python apps with registered cli commands"
26
26
  #: Current release version pulled from ``pyproject.toml`` by automation.
27
- version = "2.1.5"
27
+ version = "2.3.0"
28
28
  #: Repository homepage presented to users.
29
29
  homepage = "https://github.com/bitranox/keep_github_workflows_active"
30
30
  #: Author attribution surfaced in CLI output.
@@ -30,11 +30,13 @@ class SkippedWorkflowType(IntEnum):
30
30
 
31
31
  PAGES_BUILD_DEPLOYMENT = 1
32
32
  DEPENDABOT = 2
33
+ UPDATE_GRAPH = 3
33
34
 
34
35
 
35
36
  SKIPPED_WORKFLOW_PREFIXES: dict[SkippedWorkflowType, str] = {
36
37
  SkippedWorkflowType.PAGES_BUILD_DEPLOYMENT: "pages-build-deployment",
37
38
  SkippedWorkflowType.DEPENDABOT: "dependabot",
39
+ SkippedWorkflowType.UPDATE_GRAPH: "update-graph",
38
40
  }
39
41
 
40
42
 
@@ -336,13 +338,13 @@ def _lookup_config_value(key: str) -> str:
336
338
  >>> _ = os.environ.pop("KEEP_GITHUB_WORKFLOWS_ACTIVE_DOTENV_PATH", None)
337
339
  """
338
340
 
339
- env_value = os.environ.get(key)
341
+ env_value = os.environ.get(key, "").strip()
340
342
  if env_value:
341
343
  return env_value
342
344
 
343
345
  for env_file in _candidate_env_files():
344
346
  config = _read_env_file(env_file)
345
- file_value = config.get_value(key)
347
+ file_value = (config.get_value(key) or "").strip()
346
348
  if file_value:
347
349
  return file_value
348
350
 
@@ -493,24 +495,39 @@ def get_repositories(owner: str, github_token: str) -> list[str]:
493
495
 
494
496
  """
495
497
  repositories: list[str] = []
496
- url: str | None = f"https://api.github.com/users/{owner}/repos?per_page=100"
497
498
  headers = {"Authorization": f"Bearer {github_token}", "Accept": "application/vnd.github.v3+json"}
498
499
 
500
+ # Try the org endpoint first (returns private repos too), fall back to user endpoint.
501
+ org_url = f"https://api.github.com/orgs/{owner}/repos?per_page=100"
502
+ user_url = f"https://api.github.com/users/{owner}/repos?per_page=100"
503
+ probe = requests.get(org_url, headers=headers, timeout=REQUEST_TIMEOUT_SECONDS)
504
+ if probe.status_code == 404:
505
+ url: str | None = user_url
506
+ probe = None # Discard the 404 so the loop fetches fresh from user endpoint.
507
+ else:
508
+ url: str | None = org_url
509
+
499
510
  while url:
500
511
  try:
501
- response = requests.get(url, headers=headers, timeout=REQUEST_TIMEOUT_SECONDS)
502
- response.raise_for_status()
512
+ # Reuse the probe response for the first org page to avoid a duplicate request.
513
+ if probe is not None:
514
+ response = probe
515
+ probe = None
516
+ response.raise_for_status()
517
+ else:
518
+ response = requests.get(url, headers=headers, timeout=REQUEST_TIMEOUT_SECONDS)
519
+ response.raise_for_status()
503
520
  parsed = GitHubRepositoriesResponse.model_validate(response.json())
504
521
  repositories.extend(repo.name for repo in parsed.repositories)
505
522
  url = _get_next_page_url(response)
506
523
 
507
524
  except requests.exceptions.HTTPError as exc:
508
525
  error = GitHubErrorResponse.from_response(exc.response)
509
- result = f"ERROR reading repositories for user {owner}: {error.message}"
526
+ result = f"ERROR reading repositories for {owner}: {error.message}"
510
527
  logger.error(sanitization.sanitize_message(result))
511
528
  raise RuntimeError(result) from exc
512
529
 
513
- result = f"Found {len(repositories)} repositories for user {owner}"
530
+ result = f"Found {len(repositories)} repositories for {owner}"
514
531
  logger.info(sanitization.sanitize_message(result))
515
532
  return repositories
516
533
 
@@ -682,6 +699,8 @@ def enable_workflow(owner: str, repository: str, workflow_filename: str, github_
682
699
  result = f"Repository {repository}, workflow {workflow_filename} skipped - those can not be enabled"
683
700
  elif skip_reason == SkippedWorkflowType.DEPENDABOT:
684
701
  result = f"Repository {repository}, workflow {workflow_filename} skipped - managed by Dependabot"
702
+ elif skip_reason == SkippedWorkflowType.UPDATE_GRAPH:
703
+ result = f"Repository {repository}, workflow {workflow_filename} skipped - managed by GitHub dependency graph"
685
704
  else:
686
705
  response = requests.put(url, headers=headers, timeout=REQUEST_TIMEOUT_SECONDS)
687
706
  response.raise_for_status()
@@ -9,13 +9,23 @@ Marked with local_only to exclude from CI runs.
9
9
 
10
10
  from __future__ import annotations
11
11
 
12
+ import os
13
+
12
14
  import pytest
13
15
 
14
16
  from keep_github_workflows_active import keep_github_workflow_active as keep_active
15
17
 
16
18
 
17
19
  def _has_github_credentials() -> bool:
18
- """Check if GitHub credentials are available."""
20
+ """Check if GitHub credentials are available outside CI.
21
+
22
+ These integration tests are designed for local runs only. In CI the
23
+ secrets may point to a different account or be expired, so we rely on
24
+ the ``CI`` environment variable (always set by GitHub Actions) to
25
+ skip them unconditionally.
26
+ """
27
+ if os.environ.get("CI"):
28
+ return False
19
29
  try:
20
30
  keep_active.get_owner()
21
31
  keep_active.get_github_token()
@@ -24,7 +34,7 @@ def _has_github_credentials() -> bool:
24
34
  return False
25
35
 
26
36
 
27
- pytestmark = [pytest.mark.local_only]
37
+ pytestmark = [pytest.mark.local_only, pytest.mark.integration]
28
38
 
29
39
 
30
40
  @pytest.mark.skipif(not _has_github_credentials(), reason="GitHub credentials not available")
@@ -80,10 +90,23 @@ def test_enable_workflow_handles_known_repository() -> None:
80
90
  owner = keep_active.get_owner()
81
91
  token = keep_active.get_github_token()
82
92
 
93
+ repos = keep_active.get_repositories(owner=owner, github_token=token)
94
+ repository = None
95
+ workflow_filename = None
96
+ for repo in repos:
97
+ workflows = keep_active.get_workflows(owner=owner, repository=repo, github_token=token)
98
+ if workflows:
99
+ repository = repo
100
+ workflow_filename = workflows[0]
101
+ break
102
+
103
+ if repository is None or workflow_filename is None:
104
+ pytest.skip("No repository with workflows found for this owner")
105
+
83
106
  result = keep_active.enable_workflow(
84
107
  owner=owner,
85
- repository="lib_path",
86
- workflow_filename="python-package.yml",
108
+ repository=repository,
109
+ workflow_filename=workflow_filename,
87
110
  github_token=token,
88
111
  )
89
112