{"id":16495679,"url":"https://github.com/bitranox/keep_github_workflows_active","last_synced_at":"2026-02-07T22:31:37.529Z","repository":{"id":218018070,"uuid":"745378866","full_name":"bitranox/keep_github_workflows_active","owner":"bitranox","description":"keep github workflows active","archived":false,"fork":false,"pushed_at":"2026-02-02T00:38:02.000Z","size":199,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-02T01:33:33.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitranox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-19T07:55:06.000Z","updated_at":"2026-02-02T00:38:06.000Z","dependencies_parsed_at":"2024-01-19T10:12:11.754Z","dependency_job_id":"d398b2f9-1b3e-4104-926b-87d1b3d04ff2","html_url":"https://github.com/bitranox/keep_github_workflows_active","commit_stats":null,"previous_names":["rotekhandelsgmbh/keep_github_workflows_active","bitranox/keep_github_workflows_active"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bitranox/keep_github_workflows_active","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitranox%2Fkeep_github_workflows_active","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitranox%2Fkeep_github_workflows_active/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitranox%2Fkeep_github_workflows_active/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitranox%2Fkeep_github_workflows_active/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitranox","download_url":"https://codeload.github.com/bitranox/keep_github_workflows_active/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitranox%2Fkeep_github_workflows_active/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29211127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T22:22:11.602Z","status":"ssl_error","status_checked_at":"2026-02-07T22:22:10.684Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T14:32:05.703Z","updated_at":"2026-02-07T22:31:37.523Z","avatar_url":"https://github.com/bitranox.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# keep_github_workflows_active\n\n\u003c!-- Badges --\u003e\n[![CI](https://github.com/bitranox/keep_github_workflows_active/actions/workflows/default_cicd_public.yml/badge.svg)](https://github.com/bitranox/keep_github_workflows_active/actions/workflows/default_cicd_public.yml)\n[![CodeQL](https://github.com/bitranox/keep_github_workflows_active/actions/workflows/codeql.yml/badge.svg)](https://github.com/bitranox/keep_github_workflows_active/actions/workflows/codeql.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Open in Codespaces](https://img.shields.io/badge/Codespaces-Open-blue?logo=github\u0026logoColor=white\u0026style=flat-square)](https://codespaces.new/bitranox/keep_github_workflows_active?quickstart=1)\n[![PyPI](https://img.shields.io/pypi/v/keep_github_workflows_active.svg)](https://pypi.org/project/keep_github_workflows_active/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/keep_github_workflows_active.svg)](https://pypi.org/project/keep_github_workflows_active/)\n[![Code Style: Ruff](https://img.shields.io/badge/Code%20Style-Ruff-46A3FF?logo=ruff\u0026labelColor=000)](https://docs.astral.sh/ruff/)\n[![codecov](https://codecov.io/gh/bitranox/keep_github_workflows_active/graph/badge.svg?token=UFBaUDIgRk)](https://codecov.io/gh/bitranox/keep_github_workflows_active)\n[![Maintainability](https://qlty.sh/badges/041ba2c1-37d6-40bb-85a0-ec5a8a0aca0c/maintainability.svg)](https://qlty.sh/gh/bitranox/projects/keep_github_workflows_active)\n[![Known Vulnerabilities](https://snyk.io/test/github/bitranox/keep_github_workflows_active/badge.svg)](https://snyk.io/test/github/bitranox/keep_github_workflows_active)\n[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)\n\n\u003e **CI cadence:** The GitHub Actions CI workflow runs automatically every Monday at 07:00 UTC, in addition to push and pull request triggers.\n\n\n## Overview\n\n`keep_github_workflows_active` is an automation helper that tends to every\nGitHub Actions workflow in a user's repositories. It exists to remove the\nroutine maintenance burden that accrues when repositories go quiet and Actions\nstart to disable schedules automatically.\n\nThe automation focuses on two responsibilities:\n\n1. **Keep all workflows active** – iterate every repository owned by the\n   configured user and flip disabled workflows back to the active state so\n   cron-based automation continues to run.\n2. **Delete stale workflow runs** – retain an operator-defined number of the\n   freshest runs per workflow and delete older artifacts so storage quotas and\n   repository hygiene remain under control.\n\nBoth behaviors run as part of repository automation (for example on a nightly\nschedule) once the required GitHub token is in place.\n\n\n## Prerequisites\n\n### Generate an access token\n\nThe automation requires a fine-grained personal access token with repository\nscope. You can create one by visiting the GitHub self-service page:\n\n- [Generate fine-grained personal access token](https://github.com/settings/personal-access-tokens)\n\nWhen configuring the token, grant at least the following permissions:\n\n- **Actions:** Read/Write (needed to toggle workflow states and delete runs).\n- **Metadata:** Read (lets the script discover repositories you own).\n\nTokens expire automatically. Renew them before the expiry hits to keep the\nautomation alive. The previous test token that powered the repository expired on\n**January 19, 2025**, so any current setup must already use a newer credential.\n\n### Store the token as a repository secret\n\nAdd the token to the repository's secrets so GitHub Actions can inject it at\nruntime:\n\n- [Repository secrets](https://github.com/bitranox/keep_github_workflows_active/settings/secrets/actions)\n\nDefine the following secrets:\n\n- `SECRET_GITHUB_OWNER` – GitHub username whose repositories should be scanned.\n- `SECRET_GITHUB_TOKEN` – the fine-grained personal access token you generated.\n\nKeeping the credentials inside secrets ensures the nightly cleanup workflow can\nauthenticate without hard-coding sensitive values in the repository.\n\nFor local development you can place the same keys inside a `.env` file at the\nrepository root. The automation reads from the environment first and falls back\nto `.env` when running outside GitHub Actions.\n\n\u003e **Note:** the included tests and CLI commands exercise the live GitHub API.\n\u003e When `SECRET_GITHUB_OWNER` and `SECRET_GITHUB_TOKEN` point at a real account,\n\u003e running `make test` (or the workflow maintenance commands directly) will\n\u003e re-enable workflows and prune old workflow runs across the configured\n\u003e repositories.\n\n\n## Installation\n\nInstall the package locally when you want to run the CLI helpers or contribute\nchanges:\n\n```bash\npip install keep_github_workflows_active\n```\n\nAlternative flows (pipx, uv, editable installs, or source builds) are described\nin [INSTALL.md](INSTALL.md). All supported options expose both the\n`keep_github_workflows_active` and `keep-github-workflows-active` entry points on\nyour `PATH`.\n\n### Python 3.13+ baseline\n\n- The package targets **Python 3.13 and newer**. Older interpreters are no\n  longer supported; the codebase relies on modern conveniences such as\n  `Path.unlink(missing_ok=True)`.\n- Runtime modules now use native Python 3.13 type syntax (e.g., `list[str]`,\n  `Sequence[str] | None`) and drop legacy compatibility helpers.\n- Runtime dependencies include `rich-click` for the CLI surface and\n  `lib_cli_exit_tools` for consistent exit handling. Development extras pin the\n  tooling stack (pytest, ruff, pyright, bandit, build, twine, codecov-cli,\n  pip-audit, textual, import-linter) to their latest major releases.\n- Development dependencies were refreshed to the latest stable releases\n  (`ruff\u003e=0.14.1`, `textual\u003e=6.4.0`).\n- Continuous integration runs across GitHub's hosted runners (`ubuntu-latest`,\n  `macos-latest`, `windows-latest`) on CPython 3.13 in addition to the most\n  recent 3.x release Actions makes available.\n\n\n## Usage\n\nOnce installed and authenticated via repository secrets, schedule the automation\nfrom a GitHub Actions workflow (see `docs/systemdesign/module_reference.md` for\nthe architectural wiring). The CLI remains available for local smoke-tests and\npackaging checks while the richer workflow management helpers iterate:\n\n```bash\nkeep_github_workflows_active info\nkeep_github_workflows_active hello\nkeep_github_workflows_active fail\nkeep_github_workflows_active --traceback fail\nkeep_github_workflows_active enable-all-workflows [--owner \u003cuser\u003e] [--token \u003cpat\u003e]\nkeep_github_workflows_active delete-old-workflow-runs [--owner \u003cuser\u003e] [--token \u003cpat\u003e] [--keep \u003cn\u003e]\nkeep-github-workflows-active info\npython -m keep_github_workflows_active info\n```\n\nThe workflow maintenance commands accept optional flags. When ``--owner`` or\n``--token`` is omitted the CLI falls back to the values discovered via\nenvironment variables or the project's ``.env`` file. ``--keep`` defaults to\n``50`` workflow runs per repository.\n\nProgrammatic access is also exposed via the public helpers:\n\n```python\nimport keep_github_workflows_active as kgwa\n\nkgwa.emit_greeting()\ntry:\n    kgwa.raise_intentional_failure()\nexcept RuntimeError as exc:\n    print(f\"caught expected failure: {exc}\")\n\nkgwa.print_info()\n```\n\n\n## Security\n\nAll logging operations sanitize sensitive data before output to prevent credential\nleakage. The automation redacts:\n\n- GitHub personal access tokens (ghp_*, gho_*, etc.)\n- Authorization headers and API keys\n- Token-like patterns in error messages\n\nFor complete security documentation including incident response procedures, see\n[SECURITY.md](docs/systemdesign/SECURITY.md).\n\n## Further documentation\n\n- [Install Guide](INSTALL.md)\n- [Development Handbook](DEVELOPMENT.md)\n- [Contributor Guide](CONTRIBUTING.md)\n- [Changelog](CHANGELOG.md)\n- [Module Reference](docs/systemdesign/module_reference.md)\n- [Security Documentation](docs/systemdesign/SECURITY.md)\n- [License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitranox%2Fkeep_github_workflows_active","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitranox%2Fkeep_github_workflows_active","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitranox%2Fkeep_github_workflows_active/lists"}